# HG changeset patch # User souliane # Date 1433920714 -7200 # Node ID b06047e1c1fbebc862ea94c72518a11ed1ba4949 # Parent 5d42e2219d7c261de8226ab9c02d7621ba9d9f53 primitivus: fix setting the presence and status diff -r 5d42e2219d7c -r b06047e1c1fb frontends/src/primitivus/primitivus --- a/frontends/src/primitivus/primitivus Sat Jun 06 17:01:22 2015 +0200 +++ b/frontends/src/primitivus/primitivus Wed Jun 10 09:18:34 2015 +0200 @@ -117,6 +117,7 @@ elif command == 'messages': wid = sat_widgets.GenericList(logging.memoryGet()) self.host.selectWidget(wid) + # FIXME: reactivate the command # elif command == 'presence': # values = [value for value in commonConst.PRESENCE.keys()] # values = [value if value else 'online' for value in values] # the empty value actually means 'online' diff -r 5d42e2219d7c -r b06047e1c1fb frontends/src/primitivus/status.py --- a/frontends/src/primitivus/status.py Sat Jun 06 17:01:22 2015 +0200 +++ b/frontends/src/primitivus/status.py Wed Jun 10 09:18:34 2015 +0200 @@ -61,8 +61,9 @@ elif isinstance(user_data, sat_widgets.AdvancedEdit): new = (previous[0], new_value[0]) if new != previous: + statuses = {C.PRESENCE_STATUSES_DEFAULT: new[1]} # FIXME: manage multilingual statuses for profile in self.host.profiles: # FIXME: for now all the profiles share the same status - self.host.bridge.setPresence(show=new[0], status=new[1], profile_key=profile) # FIXME: manage multilingual statuses + self.host.bridge.setPresence(show=new[0], statuses=statuses, profile_key=profile) self.setPresenceStatus(new[0], new[1]) self.host.removePopUp() diff -r 5d42e2219d7c -r b06047e1c1fb src/core/xmpp.py --- a/src/core/xmpp.py Sat Jun 06 17:01:22 2015 +0200 +++ b/src/core/xmpp.py Wed Jun 10 09:18:34 2015 +0200 @@ -354,6 +354,13 @@ self.host.bridge.presenceUpdate(entity.full(), "unavailable", 0, statuses, self.parent.profile) def available(self, entity=None, show=None, statuses=None, priority=None): + """Set a presence and statuses. + + @param entity (jid.JID): entity + @param show (unicode): value in ('unavailable', '', 'away', 'xa', 'chat', 'dnd') + @param statuses (dict{unicode: unicode}): multilingual statuses with + the entry key beeing a language code on 2 characters or "default". + """ if priority is None: try: priority = int(self.host.memory.getParamA("Priority", "Connection", profile_key=self.parent.profile))