diff options
Diffstat (limited to 'main/src/ui/chat_input')
-rw-r--r-- | main/src/ui/chat_input/encryption_button.vala | 14 | ||||
-rw-r--r-- | main/src/ui/chat_input/occupants_tab_completer.vala | 1 | ||||
-rw-r--r-- | main/src/ui/chat_input/view.vala | 4 |
3 files changed, 12 insertions, 7 deletions
diff --git a/main/src/ui/chat_input/encryption_button.vala b/main/src/ui/chat_input/encryption_button.vala index 5fdcdaf7..439c8ebd 100644 --- a/main/src/ui/chat_input/encryption_button.vala +++ b/main/src/ui/chat_input/encryption_button.vala @@ -10,6 +10,7 @@ public class EncryptionButton : MenuButton { private Conversation? conversation; private RadioButton? button_unencrypted; private Map<RadioButton, Plugins.EncryptionListEntry> encryption_radios = new HashMap<RadioButton, Plugins.EncryptionListEntry>(); + private string? current_icon; public EncryptionButton() { relief = ReliefStyle.NONE; @@ -56,14 +57,17 @@ public class EncryptionButton : MenuButton { } } - private void update_encryption_menu_icon() { - if (conversation.encryption == Encryption.NONE) { - set_image(new Image.from_icon_name("changes-allow-symbolic", IconSize.BUTTON)); - } else { - set_image(new Image.from_icon_name("changes-prevent-symbolic", IconSize.BUTTON)); + private void set_icon(string icon) { + if (icon != current_icon) { + image = new Image.from_icon_name(icon, IconSize.BUTTON); + current_icon = icon; } } + private void update_encryption_menu_icon() { + set_icon(conversation.encryption == Encryption.NONE ? "changes-allow-symbolic" : "changes-prevent-symbolic"); + } + public new void set_conversation(Conversation conversation) { this.conversation = conversation; update_encryption_menu_state(); diff --git a/main/src/ui/chat_input/occupants_tab_completer.vala b/main/src/ui/chat_input/occupants_tab_completer.vala index 2f35bf0d..b9f5cd45 100644 --- a/main/src/ui/chat_input/occupants_tab_completer.vala +++ b/main/src/ui/chat_input/occupants_tab_completer.vala @@ -3,6 +3,7 @@ using Gee; using Gtk; using Dino.Entities; +using Xmpp; namespace Dino.Ui.ChatInput { diff --git a/main/src/ui/chat_input/view.vala b/main/src/ui/chat_input/view.vala index 007e5379..ec551647 100644 --- a/main/src/ui/chat_input/view.vala +++ b/main/src/ui/chat_input/view.vala @@ -84,8 +84,8 @@ public class View : Box { stream_interactor.get_module(MucManager.IDENTITY).change_nick(conversation.account, conversation.counterpart, token[1]); return; case "/ping": - Xmpp.Core.XmppStream? stream = stream_interactor.get_stream(conversation.account); - stream.get_module(Xmpp.Xep.Ping.Module.IDENTITY).send_ping(stream, conversation.counterpart.to_string() + "/" + token[1], null); + Xmpp.XmppStream? stream = stream_interactor.get_stream(conversation.account); + stream.get_module(Xmpp.Xep.Ping.Module.IDENTITY).send_ping(stream, conversation.counterpart.with_resource(token[1]), null); return; case "/topic": stream_interactor.get_module(MucManager.IDENTITY).change_subject(conversation.account, conversation.counterpart, token[1]); |