Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0277.py @ 343:6fe6ae70904a
plugin xep 0277: added OPT_DELIVER_PAYLOADS OPT_SEND_ITEM_SUBSCRIBE to microblog options when changing access
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 28 May 2011 20:21:45 +0200 |
parents | b0b773f432e5 |
children | f964dcec1611 |
comparison
equal
deleted
inserted
replaced
342:c413be4893b5 | 343:6fe6ae70904a |
---|---|
34 | 34 |
35 NS_MICROBLOG = 'urn:xmpp:microblog:0' | 35 NS_MICROBLOG = 'urn:xmpp:microblog:0' |
36 OPT_ACCESS_MODEL = 'pubsub#access_model' | 36 OPT_ACCESS_MODEL = 'pubsub#access_model' |
37 OPT_PERSIST_ITEMS = 'pubsub#persist_items' | 37 OPT_PERSIST_ITEMS = 'pubsub#persist_items' |
38 OPT_MAX_ITEMS = 'pubsub#max_items' | 38 OPT_MAX_ITEMS = 'pubsub#max_items' |
39 OPT_DELIVER_PAYLOADS = 'pubsub#deliver_payloads' | |
40 OPT_SEND_ITEM_SUBSCRIBE = 'pubsub#send_item_subscribe' | |
39 | 41 |
40 PLUGIN_INFO = { | 42 PLUGIN_INFO = { |
41 "name": "Microblogging over XMPP Plugin", | 43 "name": "Microblogging over XMPP Plugin", |
42 "import_name": "XEP-0277", | 44 "import_name": "XEP-0277", |
43 "type": "XEP", | 45 "type": "XEP", |
164 | 166 |
165 _jid, xmlstream = self.host.getJidNStream(profile_key) | 167 _jid, xmlstream = self.host.getJidNStream(profile_key) |
166 if not _jid: | 168 if not _jid: |
167 error(_("Can't find profile's jid")) | 169 error(_("Can't find profile's jid")) |
168 return | 170 return |
169 _options = {OPT_ACCESS_MODEL:access, OPT_PERSIST_ITEMS:1, OPT_MAX_ITEMS:-1} | 171 _options = {OPT_ACCESS_MODEL:access, OPT_PERSIST_ITEMS:1, OPT_MAX_ITEMS:-1, OPT_DELIVER_PAYLOADS:1, OPT_SEND_ITEM_SUBSCRIBE: 1} |
172 | |
170 def cb(result): | 173 def cb(result): |
171 #Node is created with right permission | 174 #Node is created with right permission |
172 debug(_("Microblog node has now access %s") % access) | 175 debug(_("Microblog node has now access %s") % access) |
173 callback() | 176 callback() |
174 | 177 |