diff options
Diffstat (limited to 'main/src/ui/conversation_details.vala')
-rw-r--r-- | main/src/ui/conversation_details.vala | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/main/src/ui/conversation_details.vala b/main/src/ui/conversation_details.vala index 4c6a0481..4b8a53b3 100644 --- a/main/src/ui/conversation_details.vala +++ b/main/src/ui/conversation_details.vala @@ -1,3 +1,4 @@ +using Dino; using Dino.Entities; using Xmpp; using Xmpp.Xep; @@ -24,6 +25,17 @@ namespace Dino.Ui.ConversationDetails { public void bind_dialog(Model.ConversationDetails model, ViewModel.ConversationDetails view_model, StreamInteractor stream_interactor) { view_model.avatar = new ViewModel.CompatAvatarPictureModel(stream_interactor).set_conversation(model.conversation); view_model.show_blocked = model.conversation.type_ == Conversation.Type.CHAT && stream_interactor.get_module(BlockingManager.IDENTITY).is_supported(model.conversation.account); + view_model.members_sorted.set_model(model.members); + view_model.members.set_map_func((item) => { + var conference_member = (Ui.Model.ConferenceMember) item; + Jid? nick_jid = stream_interactor.get_module(MucManager.IDENTITY).get_occupant_jid(model.conversation.account, model.conversation.counterpart, conference_member.jid); + return new Ui.ViewModel.ConferenceMemberListRow() { + avatar = new ViewModel.CompatAvatarPictureModel(stream_interactor).add_participant(model.conversation, conference_member.jid), + name = nick_jid != null ? nick_jid.resourcepart : conference_member.jid.localpart, + jid = conference_member.jid.to_string(), + affiliation = conference_member.affiliation + }; + }); if (model.domain_blocked) { view_model.blocked = DOMAIN; @@ -123,10 +135,11 @@ namespace Dino.Ui.ConversationDetails { }); } - public Window setup_dialog(Conversation conversation, StreamInteractor stream_interactor, Window parent) { + public Dialog setup_dialog(Conversation conversation, StreamInteractor stream_interactor, Window parent) { var dialog = new Dialog() { transient_for = parent }; var model = new Model.ConversationDetails(); - populate_dialog(model, conversation, stream_interactor); + model.populate(stream_interactor, conversation); +// populate_dialog(model, conversation, stream_interactor); bind_dialog(model, dialog.model, stream_interactor); dialog.model.about_rows.append(new ViewModel.PreferencesRow.Text() { @@ -171,6 +184,10 @@ namespace Dino.Ui.ConversationDetails { app.plugin_registry.register_contact_details_entry(new ContactDetails.PermissionsProvider(stream_interactor)); foreach (Plugins.ContactDetailsProvider provider in app.plugin_registry.contact_details_entries) { + var preferences_group = (Adw.PreferencesGroup) provider.get_widget(conversation); + if (preferences_group != null) { + dialog.add_encryption_tab_element((Adw.PreferencesGroup) provider.get_widget(conversation)); + } provider.populate(conversation, contact_details, Plugins.WidgetType.GTK4); } @@ -195,14 +212,13 @@ namespace Dino.Ui.ConversationDetails { }; switch (category) { - case "Encryption": - dialog.model.encryption_rows.append(view_model); - break; case "Permissions": case "Local Settings": case "Settings": dialog.model.settings_rows.append(view_model); break; + default: + break; } } } |