Get presence to work on the chat window
This commit is contained in:
parent
0947581a11
commit
5f628f1a4f
@ -34,8 +34,7 @@ class ActivityChat(GroupChat):
|
|||||||
addr = service.get_address()
|
addr = service.get_address()
|
||||||
port = service.get_port()
|
port = service.get_port()
|
||||||
self._chat_service = self._pservice.share_activity(self._activity,
|
self._chat_service = self._pservice.share_activity(self._activity,
|
||||||
stype=ActivityChat.SERVICE_TYPE, properties=None,
|
stype=ActivityChat.SERVICE_TYPE, address=addr, port=port)
|
||||||
address=addr, port=port)
|
|
||||||
self._setup_stream(self._chat_service)
|
self._setup_stream(self._chat_service)
|
||||||
|
|
||||||
def share(self):
|
def share(self):
|
||||||
|
@ -209,7 +209,7 @@ class Chat(gtk.VBox):
|
|||||||
def recv_message(self, message):
|
def recv_message(self, message):
|
||||||
"""Insert a remote chat message into the chat buffer."""
|
"""Insert a remote chat message into the chat buffer."""
|
||||||
[nick, msg] = Chat.deserialize_message(message)
|
[nick, msg] = Chat.deserialize_message(message)
|
||||||
buddy = self._pservice.get_buddy_by_nick_name(nick)
|
buddy = self._pservice.get_buddy_by_name(nick)
|
||||||
if not buddy:
|
if not buddy:
|
||||||
logging.error('The buddy %s is not present.' % (nick))
|
logging.error('The buddy %s is not present.' % (nick))
|
||||||
return
|
return
|
||||||
|
@ -13,7 +13,7 @@ class GroupChat(Chat):
|
|||||||
def _setup_stream(self, service):
|
def _setup_stream(self, service):
|
||||||
self._group_stream = Stream.new_from_service(service)
|
self._group_stream = Stream.new_from_service(service)
|
||||||
self._group_stream.set_data_listener(self._group_recv_message)
|
self._group_stream.set_data_listener(self._group_recv_message)
|
||||||
self._stream_writer = self._group_stream.new_writer()
|
self._stream_writer = self._group_stream.new_writer(service)
|
||||||
|
|
||||||
def _group_recv_message(self, address, msg):
|
def _group_recv_message(self, address, msg):
|
||||||
logging.debug('Group chat received from %s message %s' % (address, msg))
|
logging.debug('Group chat received from %s message %s' % (address, msg))
|
||||||
|
Loading…
Reference in New Issue
Block a user