comparison libervia/backend/plugins/plugin_misc_watched.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents 4b842c1fb686
children
comparison
equal deleted inserted replaced
4269:64a85ce8be70 4270:0d7bb4df2343
68 if show == C.PRESENCE_UNAVAILABLE: 68 if show == C.PRESENCE_UNAVAILABLE:
69 return True 69 return True
70 70
71 # we check that the previous presence was unavailable (no notification else) 71 # we check that the previous presence was unavailable (no notification else)
72 try: 72 try:
73 old_show = self.host.memory.get_entity_datum( 73 old_show = self.host.memory.get_entity_datum(client, entity, "presence").show
74 client, entity, "presence").show
75 except (KeyError, exceptions.UnknownEntityError): 74 except (KeyError, exceptions.UnknownEntityError):
76 old_show = C.PRESENCE_UNAVAILABLE 75 old_show = C.PRESENCE_UNAVAILABLE
77 76
78 if old_show == C.PRESENCE_UNAVAILABLE: 77 if old_show == C.PRESENCE_UNAVAILABLE:
79 watched = self.host.memory.param_get_a( 78 watched = self.host.memory.param_get_a(
80 NAME, CATEGORY, profile_key=client.profile) 79 NAME, CATEGORY, profile_key=client.profile
80 )
81 if entity in watched or entity.userhostJID() in watched: 81 if entity in watched or entity.userhostJID() in watched:
82 self.host.action_new( 82 self.host.action_new(
83 { 83 {
84 "xmlui": xml_tools.note( 84 "xmlui": xml_tools.note(
85 _(NOTIF).format(entity=entity.full()) 85 _(NOTIF).format(entity=entity.full())