Permalink
Browse files

Fix sending/receiving nudges. Only display that the nudge was sent if…

… papyon says it's sent.
  • Loading branch information...
1 parent 37c1bc4 commit 2a5c7567f96fd9457317f03f7f8a9053b2130cfb Alexander Godlewski committed Jul 30, 2011
@@ -120,7 +120,8 @@ def on_nudge_received(self, sender_uid):
"""
@type sender_uid: str
"""
- self._conv_widget.nudge()
+ contact = self._core._contactlist_manager.get_contact(sender_uid)
+ self._conv_widget.on_nudge_received(contact)
""" Actions from ourselves """
def send_message(self, msg, formatting=None):
@@ -135,6 +136,9 @@ def send_message(self, msg, formatting=None):
def send_nudge(self):
self._conv.send_nudge()
+
+ def on_nudge_sent(self):
+ self._conv_widget.on_nudge_sent()
def send_typing_notification(self):
self._conv.send_typing_notification()
@@ -105,3 +105,5 @@ def on_conversation_nudge_received(self, sender):
"""
self._amsn_conversation.on_nudge_received(sender.id)
+ def on_conversation_nudge_sent(self):
+ self._amsn_conversation.on_nudge_sent()
@@ -37,7 +37,10 @@ def on_message_received(self, messageview):
"""
raise NotImplementedError
- def nudge(self):
+ def on_nudge_received(self, contact):
+ """
+ @type contact: L{amsn2.core.contactlist_manager.aMSNContact}
+ """
raise NotImplementedError
def on_user_typing(self, contact):
@@ -46,3 +49,5 @@ def on_user_typing(self, contact):
"""
raise NotImplementedError
+ def on_nudge_sent(self):
+ raise NotImplementedError
@@ -227,6 +227,8 @@ def __sendMessage(self):
def __sendNudge(self):
self._amsn_conversation.send_nudge()
+
+ def on_nudge_sent(self):
self.ui.textEdit.append("<b>/me sent a nudge</b>")
def __typingNotification(self):
@@ -293,5 +295,5 @@ def on_message_received(self, messageview, formatting=None):
self._statusBar.clearMessage()
def on_nudge_received(self, sender):
- self.ui.textEdit.append(unicode("<b>"+QtCore.QString.fromUtf8(sender.to_HTML_string())+" "+self.tr("sent you a nudge!")+("</b>")))
+ self.ui.textEdit.append(unicode("<b>"+QtCore.QString.fromUtf8(sender.nickname.to_HTML_string())+" "+self.tr("sent you a nudge!")+("</b>")))
pass

0 comments on commit 2a5c756

Please sign in to comment.