plugin XEP-0184: check if entity is allowed to see our presence before returning receipt
This commit is contained in:
parent
7865ae7f99
commit
4ed0785563
1 changed files with 3 additions and 2 deletions
|
|
@ -19,7 +19,7 @@
|
|||
from sat.core.i18n import _
|
||||
from sat.core.log import getLogger
|
||||
from twisted.internet import reactor
|
||||
from twisted.words.protocols.jabber import xmlstream
|
||||
from twisted.words.protocols.jabber import xmlstream, jid
|
||||
from twisted.words.xish import domish
|
||||
log = getLogger(__name__)
|
||||
|
||||
|
|
@ -121,8 +121,9 @@ class XEP_0184(object):
|
|||
"""This method is called on message delivery receipts **request** (XEP-0184 #7)
|
||||
@param msg_elt: message element
|
||||
@param client: %(doc_client)s"""
|
||||
from_jid = jid.JID(msg_elt['from'])
|
||||
|
||||
if self._isActif(client.profile):
|
||||
if self._isActif(client.profile) and client.roster.isPresenceAuthorised(from_jid):
|
||||
received_elt_ret = domish.Element((NS_MESSAGE_DELIVERY_RECEIPTS, 'received'))
|
||||
received_elt_ret["id"] = msg_elt["id"]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue