Commit 39928f09 authored by Tijmen de Mes's avatar Tijmen de Mes

Renamed events

parent d462d04e
......@@ -1560,10 +1560,10 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
notification_center.add_observer(self, name='MediaStreamDidFail')
notification_center.add_observer(self, name='MediaStreamDidEnd')
notification_center.add_observer(self, name='MediaStreamWillEnd')
notification_center.add_observer(self, name='GotMessage')
notification_center.add_observer(self, name='GotComposingIndication')
notification_center.add_observer(self, name='DidAcceptMessage')
notification_center.add_observer(self, name='DidNotDeliverMessage')
notification_center.add_observer(self, name='BlinkGotMessage')
notification_center.add_observer(self, name='BlinkGotComposingIndication')
notification_center.add_observer(self, name='BlinkMessageDidSucceed')
notification_center.add_observer(self, name='BlinkMessageDidFail')
# self.splitter.splitterMoved.connect(self._SH_SplitterMoved) # check this and decide on what size to have in the window (see Notes) -Dan
......@@ -2272,7 +2272,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
def _NH_ChatSessionItemDidChange(self, notification):
self._update_widgets_for_session()
def _NH_GotMessage(self, notification):
def _NH_BlinkGotMessage(self, notification):
blink_session = notification.sender
session = blink_session.items.chat
......@@ -2316,15 +2316,14 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
return
session.update_composing_indication(notification.data)
def _NH_DidAcceptMessage(self, notification):
def _NH_BlinkMessageDidSucceed(self, notification):
blink_session = notification.sender
session = blink_session.items.chat
if session is None:
return
session.chat_widget.update_message_status(id=notification.data.id, status='accepted')
def _NH_DidNotDeliverMessage(self, notification):
def _NH_BlinkMessageDidFail(self, notification):
blink_session = notification.sender
session = blink_session.items.chat
if session is None:
......
......@@ -118,13 +118,13 @@ class OutgoingMessage(object):
def _NH_SIPMessageDidSucceed(self, notification):
notification_center = NotificationCenter()
notification_center.post_notification('DidAcceptMessage', sender=self.session, data=NotificationData(data=notification.data, id=self.id))
notification_center.post_notification('BlinkMessageDidSucceed', sender=self.session, data=NotificationData(data=notification.data, id=self.id))
def _NH_SIPMessageDidFail(self, notification):
if self.content_type.lower() == IsComposingDocument.content_type:
return
notification_center = NotificationCenter()
notification_center.post_notification('DidNotDeliverMessage', sender=self.session, data=NotificationData(data=notification.data, id=self.id))
notification_center.post_notification('BlinkMessageDidFail', sender=self.session, data=NotificationData(data=notification.data, id=self.id))
@implementer(IObserver)
......@@ -199,13 +199,13 @@ class MessageManager(object, metaclass=Singleton):
content_type=document.content_type.value if document.content_type is not None else None,
last_active=document.last_active.value if document.last_active is not None else None,
sender=sender)
notification_center.post_notification('GotComposingIndication', sender=blink_session, data=data)
notification_center.post_notification('BlinkGotComposingIndication', sender=blink_session, data=data)
return
timestamp = str(cpim_message.timestamp) if cpim_message is not None and cpim_message.timestamp is not None else str(ISOTimestamp.now())
message = BlinkMessage(body, content_type, sender, timestamp=timestamp, id=message_id)
notification_center.post_notification('GotMessage', sender=blink_session, data=message)
notification_center.post_notification('BlinkGotMessage', sender=blink_session, data=message)
else:
pass
# TODO handle replicated messages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment