Get one-to-one chat back to work

This commit is contained in:
Marco Pesenti Gritti 2006-07-26 16:45:40 +02:00
parent 51c08af67c
commit b4b4c13c90
2 changed files with 9 additions and 6 deletions

View File

@ -39,7 +39,7 @@ class ChatShellDbusService(dbus.service.Object):
@dbus.service.method('com.redhat.Sugar.ChatShell')
def open_chat(self, service_path):
self._parent.open_chat(service_path)
self._parent.open_chat_from_path(service_path)
class ChatListener:
def __init__(self):
@ -58,7 +58,7 @@ class ChatListener:
def _recv_message(self, address, 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 buddy:
if buddy == self._pservice.get_owner():
return
@ -74,8 +74,11 @@ class ChatListener:
logging.error('The buddy %s is not present.' % (nick))
return
def open_chat(self, service_path):
def open_chat_from_path(self, service_path):
service = self._pservice._new_object(service_path)
self.open_chat(service)
def open_chat(self, service):
chat = ChatActivity(service)
self._chats[service.get_name()] = chat
return chat

View File

@ -12,8 +12,8 @@ from sugar import theme
theme.setup()
lw = LogWriter(sys.argv[1])
lw.start()
#lw = LogWriter(sys.argv[1])
#lw.start()
if len(sys.argv) == 4:
Activity.register_factory(sys.argv[1], sys.argv[2], sys.argv[3])