plugin xep-0163: added mood publishing
This commit is contained in:
parent
b0fb8f50de
commit
0357b406ac
1 changed files with 64 additions and 3 deletions
|
|
@ -59,6 +59,20 @@ class XEP_0060():
|
|||
@param profile: profile which manage this handler"""
|
||||
self.managedNodes.append((node_name, callback))
|
||||
|
||||
def publish(self, service, nodeIdentifier, items=None, profile_key='@DEFAULT@'):
|
||||
profile = self.host.memory.getProfileName(profile_key)
|
||||
if not profile:
|
||||
err_mess = _('Trying to publish items with an unknown profile key [%s]') % profile_key
|
||||
error(err_mess)
|
||||
raise Exception(err_mess)
|
||||
try:
|
||||
client = self.clients[profile]
|
||||
except KeyError:
|
||||
err_mess = _('INTERNAL ERROR: no handler for required profile')
|
||||
error(err_mess)
|
||||
raise Exception(err_mess)
|
||||
client.publish(service, nodeIdentifier, items, client.parent.jid)
|
||||
|
||||
|
||||
class SatPubSubClient(pubsub.PubSubClient):
|
||||
implements(disco.IDisco)
|
||||
|
|
|
|||
Loading…
Reference in a new issue