message sending bug fixes + sortilege update

- sortilege now use default profile. /!\ sortilege is really buggy currently, need some attention
This commit is contained in:
Goffi 2010-02-04 01:06:36 +11:00
commit 9fd444d937

View file

@ -222,6 +222,7 @@ class SortilegeApp(QuickApp):
self.chat_wins=ChatList(self)
QuickApp.__init__(self) #XXX: yes it's an unusual place for the constructor of a parent class, but the init order is important
self.plug_profile()
signal (SIGWINCH, self.onResize) #we manage SIGWINCH ourselves, because the loop is not called otherwise
@ -271,8 +272,8 @@ class SortilegeApp(QuickApp):
def onTextEntered(self, text):
jid=JID(self.whoami)
self.bridge.sendMessage(self.currentChat, text)
jid=JID(self.profiles[self.profile]['whoami'])
self.bridge.sendMessage(self.currentChat, text, profile_key=self.profile)
def showDialog(self, message, title, type="info"):
if type==question:
@ -280,8 +281,8 @@ class SortilegeApp(QuickApp):
pass
def presenceUpdate(self, jabber_id, show, priority, statuses):
QuickApp.presenceUpdate(self, jabber_id, show, priority, statuses)
def presenceUpdate(self, jabber_id, show, priority, statuses, profile):
QuickApp.presenceUpdate(self, jabber_id, show, priority, statuses, profile)
self.editBar.replace_cur()
curses.doupdate()
@ -293,8 +294,8 @@ class SortilegeApp(QuickApp):
#FIXME
info ("FIXME: actionResult not implemented")
def newMessage(self, from_jid, msg, type, to_jid):
QuickApp.newMessage(self, from_jid, msg, type, to_jid)
def newMessage(self, from_jid, msg, type, to_jid, profile):
QuickApp.newMessage(self, from_jid, msg, type, to_jid, profile)
sender=JID(from_jid)
addr=JID(to_jid)
win = addr if sender.short == self.whoami.short else sender #FIXME: duplicate code with QuickApp