diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-02 15:37:32 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-02 15:37:32 +0100 |
commit | 56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d (patch) | |
tree | 0bd0c2c80cb81179c26282fb3fbe8fd22983f40b /client/src/ui/conversation_selector/groupchat_row.vala | |
download | dino-56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d.tar.gz dino-56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d.zip |
Initial commit
Diffstat (limited to 'client/src/ui/conversation_selector/groupchat_row.vala')
-rw-r--r-- | client/src/ui/conversation_selector/groupchat_row.vala | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/client/src/ui/conversation_selector/groupchat_row.vala b/client/src/ui/conversation_selector/groupchat_row.vala new file mode 100644 index 00000000..bec2181e --- /dev/null +++ b/client/src/ui/conversation_selector/groupchat_row.vala @@ -0,0 +1,33 @@ +using Dino.Entities; + +namespace Dino.Ui.ConversationSelector { +public class GroupchatRow : ConversationRow { + + public GroupchatRow(StreamInteractor stream_interactor, Conversation conversation) { + base(stream_interactor, conversation); + has_tooltip = true; + set_tooltip_text(conversation.counterpart.bare_jid.to_string()); + set_avatar((new AvatarGenerator(AVATAR_SIZE, AVATAR_SIZE, image.scale_factor)) + .set_greyscale(true) + .draw_conversation(stream_interactor, conversation), image.scale_factor); + x_button.clicked.connect(on_x_button_clicked); + } + + + public override void on_show_received(Show show) { + set_avatar((new AvatarGenerator(AVATAR_SIZE, AVATAR_SIZE, image.scale_factor)) + .draw_conversation(stream_interactor, conversation), image.scale_factor); + } + + public override void network_connection(bool connected) { + set_avatar((new AvatarGenerator(AVATAR_SIZE, AVATAR_SIZE, image.scale_factor)) + .set_greyscale(!connected || + MucManager.get_instance(stream_interactor).get_nick(conversation.counterpart, conversation.account) == null) // TODO better currently joined + .draw_conversation(stream_interactor, conversation), image.scale_factor); + } + + private void on_x_button_clicked() { + MucManager.get_instance(stream_interactor).part(conversation.account, conversation.counterpart); + } +} +}
\ No newline at end of file |