Reformatted code base using black.

This commit is contained in:
Goffi 2024-06-19 18:44:57 +02:00
commit 53fdaa9d09

View file

@ -100,7 +100,9 @@ class XEP_0085(object):
def __init__(self, host):
log.info(_("Chat State Notifications plugin initialization"))
self.host = host
self.map = {} # FIXME: would be better to use client instead of mapping profile to data
self.map = (
{}
) # FIXME: would be better to use client instead of mapping profile to data
# parameter value is retrieved before each use
host.memory.update_params(self.params)
@ -149,9 +151,7 @@ class XEP_0085(object):
if value == DELETE_VALUE:
self.host.memory.del_entity_datum(client, entity_jid, ENTITY_KEY)
else:
self.host.memory.update_entity_data(
client, entity_jid, ENTITY_KEY, value
)
self.host.memory.update_entity_data(client, entity_jid, ENTITY_KEY, value)
if not value or value == DELETE_VALUE:
# reinit chat state UI for this or these contact(s)
self.host.bridge.chat_state_received(entity_jid.full(), "", profile)
@ -260,7 +260,8 @@ class XEP_0085(object):
client = self.host.get_client(profile)
try:
type_ = self.host.memory.get_entity_datum(
client, to_jid.userhostJID(), C.ENTITY_TYPE)
client, to_jid.userhostJID(), C.ENTITY_TYPE
)
if type_ == C.ENTITY_TYPE_MUC:
return True
except (exceptions.UnknownEntityError, KeyError):