frontends: fixed sendMessage calls, sendMessage is now async so callback and errback need to be specified + redraw in PrimivitusApp.notify

This commit is contained in:
Goffi 2014-01-03 21:25:07 +01:00
commit fc003ecf77

View file

@ -280,11 +280,15 @@ class QuickApp(object):
timestamp = extra.get('archive')
self.chat_wins[win.bare].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '')
def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, profile_key="@NONE@"):
def sendMessage(self, to_jid, message, subject='', mess_type="auto", extra={}, callback=None, errback=None, profile_key="@NONE@"):
if to_jid.startswith(Const.PRIVATE_PREFIX):
to_jid = unescapePrivate(to_jid)
mess_type = "chat"
self.bridge.sendMessage(to_jid, message, subject, mess_type, extra, profile_key)
if callback is None:
callback = lambda: None
if errback is None:
errback = lambda failure: self.showDialog(unicode(failure), _(u"sendMessage Error"), "error")
self.bridge.sendMessage(to_jid, message, subject, mess_type, extra, profile_key, callback=callback, errback=errback)
def newAlert(self, msg, title, alert_type, profile):
if not self.check_profile(profile):