comparison frontends/sortilege/sortilege @ 67:0e50dd3a234a

message sending bug fixes + sortilege update - sortilege now use default profile. /!\ sortilege is really buggy currently, need some attention
author Goffi <goffi@goffi.org>
date Thu, 04 Feb 2010 01:06:36 +1100
parents a5b5fb5fc9fd
children 8f2ed279784b
comparison
equal deleted inserted replaced
66:8147b4f40809 67:0e50dd3a234a
220 self.editBar.registerEnterCB(self.onTextEntered) 220 self.editBar.registerEnterCB(self.onTextEntered)
221 221
222 self.chat_wins=ChatList(self) 222 self.chat_wins=ChatList(self)
223 223
224 QuickApp.__init__(self) #XXX: yes it's an unusual place for the constructor of a parent class, but the init order is important 224 QuickApp.__init__(self) #XXX: yes it's an unusual place for the constructor of a parent class, but the init order is important
225 self.plug_profile()
225 226
226 signal (SIGWINCH, self.onResize) #we manage SIGWINCH ourselves, because the loop is not called otherwise 227 signal (SIGWINCH, self.onResize) #we manage SIGWINCH ourselves, because the loop is not called otherwise
227 228
228 #last but not least, we adapt windows' sizes 229 #last but not least, we adapt windows' sizes
229 self.sizer.update() 230 self.sizer.update()
269 self.statusBar.hide() 270 self.statusBar.hide()
270 self.sizer.update() 271 self.sizer.update()
271 272
272 273
273 def onTextEntered(self, text): 274 def onTextEntered(self, text):
274 jid=JID(self.whoami) 275 jid=JID(self.profiles[self.profile]['whoami'])
275 self.bridge.sendMessage(self.currentChat, text) 276 self.bridge.sendMessage(self.currentChat, text, profile_key=self.profile)
276 277
277 def showDialog(self, message, title, type="info"): 278 def showDialog(self, message, title, type="info"):
278 if type==question: 279 if type==question:
279 raise NotImplementedError 280 raise NotImplementedError
280 pass 281 pass
281 282
282 283
283 def presenceUpdate(self, jabber_id, show, priority, statuses): 284 def presenceUpdate(self, jabber_id, show, priority, statuses, profile):
284 QuickApp.presenceUpdate(self, jabber_id, show, priority, statuses) 285 QuickApp.presenceUpdate(self, jabber_id, show, priority, statuses, profile)
285 self.editBar.replace_cur() 286 self.editBar.replace_cur()
286 curses.doupdate() 287 curses.doupdate()
287 288
288 def askConfirmation(self, type, id, data): 289 def askConfirmation(self, type, id, data):
289 #FIXME 290 #FIXME
291 292
292 def actionResult(self, type, id, data): 293 def actionResult(self, type, id, data):
293 #FIXME 294 #FIXME
294 info ("FIXME: actionResult not implemented") 295 info ("FIXME: actionResult not implemented")
295 296
296 def newMessage(self, from_jid, msg, type, to_jid): 297 def newMessage(self, from_jid, msg, type, to_jid, profile):
297 QuickApp.newMessage(self, from_jid, msg, type, to_jid) 298 QuickApp.newMessage(self, from_jid, msg, type, to_jid, profile)
298 sender=JID(from_jid) 299 sender=JID(from_jid)
299 addr=JID(to_jid) 300 addr=JID(to_jid)
300 win = addr if sender.short == self.whoami.short else sender #FIXME: duplicate code with QuickApp 301 win = addr if sender.short == self.whoami.short else sender #FIXME: duplicate code with QuickApp
301 if (self.currentChat==None): 302 if (self.currentChat==None):
302 self.currentChat=win.short 303 self.currentChat=win.short