From 5fcf8e73efeea60413a383e6e6a096a3981be1a2 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 23 Aug 2017 20:30:44 +0200 Subject: Show nicks in MUCs, real jid in individual occupant menu --- main/src/ui/occupant_menu/view.vala | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'main/src/ui/occupant_menu') diff --git a/main/src/ui/occupant_menu/view.vala b/main/src/ui/occupant_menu/view.vala index 7918fe46..b93e38e6 100644 --- a/main/src/ui/occupant_menu/view.vala +++ b/main/src/ui/occupant_menu/view.vala @@ -12,6 +12,7 @@ public class View : Popover { private Stack stack = new Stack() { vhomogeneous=false, visible=true }; private List list; private ListBox invite_list; + private Box? jid_menu = null; public View(StreamInteractor stream_interactor, Window window, Conversation conversation) { this.stream_interactor = stream_interactor; @@ -63,13 +64,16 @@ public class View : Popover { stack.visible_child_name = "list"; } - private void show_menu(Jid jid, string name_label) { + private void show_menu(Jid jid, string name_) { stack.transition_type = StackTransitionType.SLIDE_LEFT; + string name = name_; + Jid? real_jid = stream_interactor.get_module(MucManager.IDENTITY).get_real_jid(jid, conversation.account); + if (real_jid != null) name += @"\n$(real_jid.bare_jid)"; + Box header_box = new Box(Orientation.HORIZONTAL, 5) { visible=true }; header_box.add(new Image.from_icon_name("pan-start-symbolic", IconSize.SMALL_TOOLBAR) { visible=true }); - header_box.add(new Label(name_label) { xalign=0.5f, hexpand=true, visible=true }); - + header_box.add(new Label(name) { xalign=0, use_markup=true, hexpand=true, visible=true }); Button header_button = new Button() { relief=ReliefStyle.NONE, visible=true }; header_button.add(header_box); @@ -90,8 +94,10 @@ public class View : Popover { kick_button.clicked.connect(kick_button_clicked); } + if (jid_menu != null) stack.remove(jid_menu); stack.add_named(outer_box, "menu"); stack.visible_child_name = "menu"; + jid_menu = outer_box; } private void private_conversation_button_clicked() { @@ -110,4 +116,4 @@ public class View : Popover { } } -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2