diff --git a/src/dialogs/chatty-ma-chat-info.c b/src/dialogs/chatty-ma-chat-info.c index cf36c51fdfa06333d4c0c235dc3f5d4041093b91..872e43d6a2dc1345f693acbe718d6b1955737f47 100644 --- a/src/dialogs/chatty-ma-chat-info.c +++ b/src/dialogs/chatty-ma-chat-info.c @@ -48,6 +48,7 @@ struct _ChattyMaChatInfo GtkWidget *name_row; GtkWidget *matrix_id_row; GtkWidget *topic_row; + GtkWidget *room_version_row; GtkWidget *encryption_spinner; GtkWidget *encryption_row; @@ -138,7 +139,7 @@ chatty_ma_chat_info_set_item (ChattyChatInfo *info, ChattyChat *chat) { ChattyMaChatInfo *self = (ChattyMaChatInfo *)info; - const char *topic; + const char *topic, *room_version; g_assert (CHATTY_IS_MA_CHAT_INFO (self)); g_assert (!chat || CHATTY_IS_MA_CHAT (chat)); @@ -161,10 +162,14 @@ chatty_ma_chat_info_set_item (ChattyChatInfo *info, topic = chatty_ma_chat_get_topic (CHATTY_MA_CHAT (self->chat)); gtk_widget_set_visible (self->topic_row, !!topic); - if (topic) adw_action_row_set_subtitle (ADW_ACTION_ROW (self->topic_row), topic); + room_version = chatty_ma_chat_get_room_version (CHATTY_MA_CHAT (self->chat)); + gtk_widget_set_visible (self->room_version_row, !!room_version); + if (room_version) + adw_action_row_set_subtitle (ADW_ACTION_ROW (self->room_version_row), room_version); + g_signal_connect_swapped (self->chat, "notify::encrypt", G_CALLBACK (ma_chat_encrypt_changed_cb), self); @@ -214,6 +219,7 @@ chatty_ma_chat_info_class_init (ChattyMaChatInfoClass *klass) gtk_widget_class_bind_template_child (widget_class, ChattyMaChatInfo, name_row); gtk_widget_class_bind_template_child (widget_class, ChattyMaChatInfo, matrix_id_row); gtk_widget_class_bind_template_child (widget_class, ChattyMaChatInfo, topic_row); + gtk_widget_class_bind_template_child (widget_class, ChattyMaChatInfo, room_version_row); gtk_widget_class_bind_template_child (widget_class, ChattyMaChatInfo, encryption_spinner); gtk_widget_class_bind_template_child (widget_class, ChattyMaChatInfo, encryption_row); gtk_widget_class_bind_template_child (widget_class, ChattyMaChatInfo, members_group); diff --git a/src/matrix/chatty-ma-chat.c b/src/matrix/chatty-ma-chat.c index cabe7a005b5f73394a5608fcf64da0f79c4a1561..2d9b2e64a3681b9dc1290c9a4b85e2e144bde44b 100644 --- a/src/matrix/chatty-ma-chat.c +++ b/src/matrix/chatty-ma-chat.c @@ -1051,3 +1051,11 @@ chatty_ma_chat_get_topic (ChattyMaChat *self) return cm_room_get_topic (self->cm_room); } + +const char * +chatty_ma_chat_get_room_version (ChattyMaChat *self) +{ + g_return_val_if_fail (CHATTY_IS_MA_CHAT (self), NULL); + + return cm_room_get_room_version (self->cm_room); +} diff --git a/src/matrix/chatty-ma-chat.h b/src/matrix/chatty-ma-chat.h index c655dbae378e2f1511035dcb8ce8b0ccc5f36d22..c403383a179aec6e6ca85c9fb86da89996824b66 100644 --- a/src/matrix/chatty-ma-chat.h +++ b/src/matrix/chatty-ma-chat.h @@ -26,6 +26,7 @@ ChattyMaChat *chatty_ma_chat_new_with_room (CmRoom *room); CmRoom *chatty_ma_chat_get_cm_room (ChattyMaChat *self); gboolean chatty_ma_chat_can_set_encryption (ChattyMaChat *self); const char *chatty_ma_chat_get_topic (ChattyMaChat *self); +const char *chatty_ma_chat_get_room_version (ChattyMaChat *self); void chatty_ma_chat_set_data (ChattyMaChat *self, ChattyAccount *account, gpointer client); diff --git a/src/ui/chatty-ma-chat-info.ui b/src/ui/chatty-ma-chat-info.ui index ca4063073a215e1edea2e9559bf4583079f0016c..9dfac14366d4cf63b2274daedff2b023be937f37 100644 --- a/src/ui/chatty-ma-chat-info.ui +++ b/src/ui/chatty-ma-chat-info.ui @@ -30,11 +30,17 @@ - + Topic + + + + Room version + + diff --git a/subprojects/libcmatrix.wrap b/subprojects/libcmatrix.wrap index d2330b6f53c2712ab68361120cd2109e7157371e..f2c25dba9fa2744cf09d448141b3e6cb38025555 100644 --- a/subprojects/libcmatrix.wrap +++ b/subprojects/libcmatrix.wrap @@ -1,5 +1,5 @@ [wrap-git] directory=libcmatrix url=https://source.puri.sm/Librem5/libcmatrix.git -revision=v0.0.3 +revision=v0.0.4 depth=1