Commit 69679f12 authored by Alexander's avatar Alexander

[stickers] Disallow sending stickers when using encryption

parent 5ff2ddd9
Pipeline #6891 passed with stage
in 2 minutes and 14 seconds
...@@ -44,6 +44,7 @@ from gajim.common import app ...@@ -44,6 +44,7 @@ from gajim.common import app
from gajim.common import ged from gajim.common import ged
from gajim.common.structs import OutgoingMessage from gajim.common.structs import OutgoingMessage
from gajim.gui.dialogs import ConfirmationDialog from gajim.gui.dialogs import ConfirmationDialog
from gajim.gui.dialogs import InformationDialog
from gajim.gui.dialogs import DialogButton from gajim.gui.dialogs import DialogButton
from gajim.plugins import GajimPlugin from gajim.plugins import GajimPlugin
...@@ -855,20 +856,17 @@ class StickersButton(Gtk.Button): ...@@ -855,20 +856,17 @@ class StickersButton(Gtk.Button):
'desc': sticker.desc 'desc': sticker.desc
} }
###### self._conn.send_message(outgoing)
# TODO: Use this to send the message and automatically
# encrypt and put it into the history.
# This would require SCE to be implemented as
# the <sticker> and <file-sharing> nodes would otherwise be discarded.
# self._conn.send_message(outgoing)
stanza = self._conn.get_module('Message').build_message_stanza(outgoing)
outgoing.stanza = stanza
# pylint: disable=protected-access
self._conn._send_message(outgoing)
######
def _on_clicked(self, btn): def _on_clicked(self, btn):
# pylint: disable=unused-argument # pylint: disable=unused-argument
# TODO: Remove once we can send <sticker> and <file-sharing> with
# encryption.
if self._chat_control.encryption:
InformationDialog(_('Cannot Send Stickers'),
_('Stickers are unavailable when using encryption.')).show()
return
self._popover.set_relative_to(self) self._popover.set_relative_to(self)
self._popover.show_all() self._popover.show_all()
self._popover.popup() self._popover.popup()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment