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): ...@@ -1560,10 +1560,10 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
notification_center.add_observer(self, name='MediaStreamDidFail') notification_center.add_observer(self, name='MediaStreamDidFail')
notification_center.add_observer(self, name='MediaStreamDidEnd') notification_center.add_observer(self, name='MediaStreamDidEnd')
notification_center.add_observer(self, name='MediaStreamWillEnd') notification_center.add_observer(self, name='MediaStreamWillEnd')
notification_center.add_observer(self, name='GotMessage') notification_center.add_observer(self, name='BlinkGotMessage')
notification_center.add_observer(self, name='GotComposingIndication') notification_center.add_observer(self, name='BlinkGotComposingIndication')
notification_center.add_observer(self, name='DidAcceptMessage') notification_center.add_observer(self, name='BlinkMessageDidSucceed')
notification_center.add_observer(self, name='DidNotDeliverMessage') 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 # 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): ...@@ -2272,7 +2272,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
def _NH_ChatSessionItemDidChange(self, notification): def _NH_ChatSessionItemDidChange(self, notification):
self._update_widgets_for_session() self._update_widgets_for_session()
def _NH_GotMessage(self, notification): def _NH_BlinkGotMessage(self, notification):
blink_session = notification.sender blink_session = notification.sender
session = blink_session.items.chat session = blink_session.items.chat
...@@ -2316,15 +2316,14 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin): ...@@ -2316,15 +2316,14 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
return return
session.update_composing_indication(notification.data) session.update_composing_indication(notification.data)
def _NH_DidAcceptMessage(self, notification): def _NH_BlinkMessageDidSucceed(self, notification):
blink_session = notification.sender blink_session = notification.sender
session = blink_session.items.chat session = blink_session.items.chat
if session is None: if session is None:
return return
session.chat_widget.update_message_status(id=notification.data.id, status='accepted') session.chat_widget.update_message_status(id=notification.data.id, status='accepted')
def _NH_BlinkMessageDidFail(self, notification):
def _NH_DidNotDeliverMessage(self, notification):
blink_session = notification.sender blink_session = notification.sender
session = blink_session.items.chat session = blink_session.items.chat
if session is None: if session is None:
......
...@@ -118,13 +118,13 @@ class OutgoingMessage(object): ...@@ -118,13 +118,13 @@ class OutgoingMessage(object):
def _NH_SIPMessageDidSucceed(self, notification): def _NH_SIPMessageDidSucceed(self, notification):
notification_center = NotificationCenter() 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): def _NH_SIPMessageDidFail(self, notification):
if self.content_type.lower() == IsComposingDocument.content_type: if self.content_type.lower() == IsComposingDocument.content_type:
return return
notification_center = NotificationCenter() 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) @implementer(IObserver)
...@@ -199,13 +199,13 @@ class MessageManager(object, metaclass=Singleton): ...@@ -199,13 +199,13 @@ class MessageManager(object, metaclass=Singleton):
content_type=document.content_type.value if document.content_type is not None else None, 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, last_active=document.last_active.value if document.last_active is not None else None,
sender=sender) sender=sender)
notification_center.post_notification('GotComposingIndication', sender=blink_session, data=data) notification_center.post_notification('BlinkGotComposingIndication', sender=blink_session, data=data)
return return
timestamp = str(cpim_message.timestamp) if cpim_message is not None and cpim_message.timestamp is not None else str(ISOTimestamp.now()) 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) 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: else:
pass pass
# TODO handle replicated messages # 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