Compare commits

...

2 Commits

@ -176,4 +176,5 @@ class OTR(context.Account):
event.encrypted, event.additional_data["encrypted"] = OTR.ENCRYPTION_NAME, {"name":OTR.ENCRYPTION_NAME} # some mandatory encryption flags event.encrypted, event.additional_data["encrypted"] = OTR.ENCRYPTION_NAME, {"name":OTR.ENCRYPTION_NAME} # some mandatory encryption flags
if channel.resource: if channel.resource:
event.stanza.addChild('no-copy', namespace='urn:xmpp:hints') # don't send carbons event.stanza.addChild('no-copy', namespace='urn:xmpp:hints') # don't send carbons
event.stanza.addChild('no-store', namespace='urn:xmpp:hints') # don't store in MAM
callback(event) callback(event)

@ -14,8 +14,8 @@
"win32" "win32"
], ],
"requirements": [ "requirements": [
"gajim>=1.5,<1.9" "gajim>=1.6,<1.9"
], ],
"short_name": "otrplugin", "short_name": "otrplugin",
"version": "0.5" "version": "0.5.2"
} }

@ -56,7 +56,7 @@ class OTRPlugin(GajimPlugin):
self.modules = [module] self.modules = [module]
self.gui_extension_points = { self.gui_extension_points = {
'encrypt' + self.encryption_name: (self._encrypt_message, None), 'encrypt' + self.encryption_name: (self._encrypt_message, None),
# 'message_actions_box': (self._message_actions_box_activate, self._message_actions_box_deactivate), 'message_actions_box': (self._message_actions_box_activate, self._message_actions_box_deactivate),
} }
self._menuitem = None self._menuitem = None
@ -69,15 +69,13 @@ class OTRPlugin(GajimPlugin):
return grid._ui.encryption_menu_button.get_menu_model() return grid._ui.encryption_menu_button.get_menu_model()
def activate(self): def activate(self):
pass if app.window is not None and self._menuitem is None:
# if app.window is not None: grid = self._get_grid()
# grid = self._get_grid() self._actions_hack_activate(grid)
# self._actions_hack_activate(grid)
def deactivate(self): def deactivate(self):
pass grid = self._get_grid()
# grid = self._get_grid() self._actions_hack_deactivate(grid)
# self._actions_hack_deactivate(grid)
@staticmethod @staticmethod
def get_otr(account): def get_otr(account):
@ -109,7 +107,7 @@ class OTRPlugin(GajimPlugin):
def _actions_hack_activate(self, grid): def _actions_hack_activate(self, grid):
model = grid._ui.encryption_menu_button.get_menu_model() model = grid._ui.encryption_menu_button.get_menu_model()
menuitem = make_menu_item('OTR', 'win.set-encryption', '"OTR"') menuitem = make_menu_item('OTR', 'win.set-encryption', 'OTR')
self._menuitem = menuitem.get_attribute_value(Gio.MENU_ATTRIBUTE_LABEL) self._menuitem = menuitem.get_attribute_value(Gio.MENU_ATTRIBUTE_LABEL)
model.append_item(menuitem) model.append_item(menuitem)

Loading…
Cancel
Save