Commit 3f03e6e0 authored by Philipp Hörist's avatar Philipp Hörist

Better handle disable notifitcations

parent 59b39b04
Pipeline #3014 failed with stages
in 3 minutes and 52 seconds
......@@ -45,17 +45,17 @@ class UserActivity(BaseModule):
@event_node(nbxmpp.NS_ACTIVITY)
def _activity_received(self, _con, _stanza, properties):
data = properties.pubsub_event.data
if data is None:
return
empty = properties.pubsub_event.empty
for contact in app.contacts.get_contacts(self._account,
str(properties.jid)):
if data.activity is not None:
if not empty:
contact.pep[PEPEventType.ACTIVITY] = data
else:
contact.pep.pop(PEPEventType.ACTIVITY, None)
if properties.is_self_message:
if data.activity is not None:
if not empty:
self._con.pep[PEPEventType.ACTIVITY] = data
else:
self._con.pep.pop(PEPEventType.ACTIVITY, None)
......
......@@ -45,17 +45,17 @@ class UserMood(BaseModule):
@event_node(nbxmpp.NS_MOOD)
def _mood_received(self, _con, _stanza, properties):
data = properties.pubsub_event.data
if data is None:
return
empty = properties.pubsub_event.empty
for contact in app.contacts.get_contacts(self._account,
str(properties.jid)):
if data.mood is not None:
if not empty:
contact.pep[PEPEventType.MOOD] = data
else:
contact.pep.pop(PEPEventType.MOOD, None)
if properties.is_self_message:
if data.mood is not None:
if not empty:
self._con.pep[PEPEventType.MOOD] = data
else:
self._con.pep.pop(PEPEventType.MOOD, None)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment