quick_frontend (quick_app): fixes the call to a bridge method that was done with a JID instead of unicode
This commit is contained in:
parent
b5d70cbe34
commit
fa8f119a56
1 changed files with 9 additions and 4 deletions
|
|
@ -29,6 +29,13 @@ from sat_frontends.quick_frontend import quick_chat
|
||||||
from sat_frontends.quick_frontend.constants import Const as C
|
from sat_frontends.quick_frontend.constants import Const as C
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
# FIXME: to be removed when an acceptable solution is here
|
||||||
|
unicode('') # XXX: unicode doesn't exist in pyjamas
|
||||||
|
except (TypeError, AttributeError): # Error raised is not the same depending on pyjsbuild options
|
||||||
|
unicode = str
|
||||||
|
|
||||||
|
|
||||||
class ProfileManager(object):
|
class ProfileManager(object):
|
||||||
"""Class managing all data relative to one profile, and plugging in mechanism"""
|
"""Class managing all data relative to one profile, and plugging in mechanism"""
|
||||||
host = None
|
host = None
|
||||||
|
|
@ -601,10 +608,8 @@ class QuickApp(object):
|
||||||
|
|
||||||
def _subscribe_cb(self, answer, data):
|
def _subscribe_cb(self, answer, data):
|
||||||
entity, profile = data
|
entity, profile = data
|
||||||
if answer:
|
type_ = "subscribed" if answer else "unsubscribed"
|
||||||
self.bridge.subscription("subscribed", entity.bare, profile_key=profile)
|
self.bridge.subscription(type_, unicode(entity.bare), profile_key=profile)
|
||||||
else:
|
|
||||||
self.bridge.subscription("unsubscribed", entity.bare, profile_key=profile)
|
|
||||||
|
|
||||||
def subscribeHandler(self, type, raw_jid, profile):
|
def subscribeHandler(self, type, raw_jid, profile):
|
||||||
"""Called when a subsciption management signal is received"""
|
"""Called when a subsciption management signal is received"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue