[acronyms] Adapt to upstream changes

This commit is contained in:
wurstsalat
2021-03-25 21:40:35 +01:00
parent f59cc5cb56
commit dd2f99e658

View File

@@ -84,7 +84,7 @@ class AcronymsExpanderPlugin(GajimPlugin):
self.acronyms = acronyms self.acronyms = acronyms
self._save_acronyms(acronyms) self._save_acronyms(acronyms)
def _on_buffer_changed(self, _textview, buffer_, contact, account): def _on_buffer_changed(self, buffer_, contact, account):
if self._replace_in_progress: if self._replace_in_progress:
return return
@@ -142,16 +142,16 @@ class AcronymsExpanderPlugin(GajimPlugin):
self._replace_in_progress = False self._replace_in_progress = False
def _connect(self, chat_control): def _connect(self, chat_control):
textview = chat_control.msg_textview text_buffer = chat_control.msg_textview.get_buffer()
handler_id = textview.connect('text-changed', handler_id = text_buffer.connect('changed',
self._on_buffer_changed, self._on_buffer_changed,
chat_control.contact, chat_control.contact,
chat_control.account) chat_control.account)
self._handler_ids[id(textview)] = handler_id self._handler_ids[id(text_buffer)] = handler_id
def _disconnect(self, chat_control): def _disconnect(self, chat_control):
textview = chat_control.msg_textview text_buffer = chat_control.msg_textview.get_buffer()
handler_id = self._handler_ids.get(id(textview)) handler_id = self._handler_ids.get(id(text_buffer))
if handler_id is not None: if handler_id is not None:
textview.disconnect(handler_id) text_buffer.disconnect(handler_id)
del self._handler_ids[id(textview)] del self._handler_ids[id(text_buffer)]