[length_notifier] 1.4.7

Fixes #608
This commit is contained in:
wurstsalat
2022-11-05 16:06:32 +01:00
parent d99a6d33e4
commit 2fbc937b12
2 changed files with 14 additions and 10 deletions

View File

@@ -57,7 +57,7 @@ class LengthNotifierPlugin(GajimPlugin):
self.config_dialog = partial(LengthNotifierConfigDialog, self)
self.gui_extension_points = {
'message_actions_box': (self._connect, None),
'message_actions_box': (self._message_actions_box_created, None),
'switch_contact': (self._on_switch_contact, None)
}
@@ -85,6 +85,7 @@ class LengthNotifierPlugin(GajimPlugin):
def deactivate(self) -> None:
assert self._counter is not None
self._counter.reset()
self._counter.destroy()
del self._counter
@@ -95,19 +96,17 @@ class LengthNotifierPlugin(GajimPlugin):
self.config)
self._actions_box_widget.pack_end(self._counter, False, False, 0)
def _connect(self,
message_actions_box: MessageActionsBox,
gtk_box: Gtk.Box
) -> None:
def _message_actions_box_created(self,
message_actions_box: MessageActionsBox,
gtk_box: Gtk.Box
) -> None:
self._message_action_box = message_actions_box
self._actions_box_widget = gtk_box
self._create_counter()
def _on_switch_contact(self, contact: types.ChatContactT) -> None:
if self._counter is None:
return
assert self._counter is not None
self._contact = contact
self._counter.update_contact(contact)
@@ -211,7 +210,12 @@ class Counter(Gtk.Label):
return False
def _jid_allowed(self, current_jid: JID) -> bool:
jids = cast(str, self._config['JIDS'])
jids = self._config['JIDS']
if isinstance(jids, list):
# Gajim 1.0 stored this as list[str]
jids = ','.join(jids)
assert isinstance(jids, str)
if not len(jids):
# Not restricted to any JIDs
return True

View File

@@ -16,5 +16,5 @@
"gajim>=1.5.0"
],
"short_name": "length_notifier",
"version": "1.4.6"
"version": "1.4.7"
}