plugin xep-0163: added mood publishing

This commit is contained in:
Goffi 2011-02-04 01:06:57 +01:00
commit 0357b406ac

View file

@ -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)