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:
parent
401f47273b
commit
fc003ecf77
1 changed files with 15 additions and 10 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue