plugin XEP-0280: new setPrivate method to tell server not to carbon copy it.
This commit is contained in:
parent
503f8644ba
commit
89b8cb3341
1 changed files with 19 additions and 7 deletions
|
|
@ -39,14 +39,14 @@ PARAM_LABEL = D_(u"Message carbons")
|
|||
NS_CARBONS = 'urn:xmpp:carbons:2'
|
||||
|
||||
PLUGIN_INFO = {
|
||||
"name": "XEP-0280 Plugin",
|
||||
"import_name": "XEP-0280",
|
||||
"type": "XEP",
|
||||
"protocols": ["XEP-0280"],
|
||||
"name": u"XEP-0280 Plugin",
|
||||
"import_name": u"XEP-0280",
|
||||
"type": u"XEP",
|
||||
"protocols": [u"XEP-0280"],
|
||||
"dependencies": [],
|
||||
"main": "XEP_0280",
|
||||
"handler": "yes",
|
||||
"description": _("""Implementation of Message Carbons""")
|
||||
"main": u"XEP_0280",
|
||||
"handler": u"yes",
|
||||
"description": D_(u"""Implementation of Message Carbons""")
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -79,6 +79,18 @@ class XEP_0280(object):
|
|||
def getHandler(self, profile):
|
||||
return XEP_0280_handler()
|
||||
|
||||
def setPrivate(self, message_elt):
|
||||
"""Add a <private/> element to a message
|
||||
|
||||
this method is intented to be called on final domish.Element by other plugins
|
||||
(in particular end 2 end encryption plugins)
|
||||
@param message_elt(domish.Element): <message> stanza
|
||||
"""
|
||||
if message_elt.name != u'message':
|
||||
log.error(u"addPrivateElt must be used with <message> stanzas")
|
||||
return
|
||||
message_elt.addElement((NS_CARBONS, u'private'))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def profileConnected(self, profile):
|
||||
"""activate message carbons on connection if possible and activated in config"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue