Commit 366243fc authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud

currentcallview: fix Gtk warning and critical messages

- fix new-messages-displayed signal's name (new-interactions-displayed)
- call update_temporary on the correct object.

Change-Id: Id95637b4621f7e39842c9bca67a0c21629b8138c
parent 5851aaf8
......@@ -84,6 +84,7 @@ struct _CurrentCallViewPrivate
GtkWidget *button_hangup;
GtkWidget *scalebutton_quality;
GtkWidget *checkbutton_autoquality;
GtkWidget *chat_view;
/* The webkit_chat_container is created once, then reused for all chat
* views */
......@@ -864,11 +865,11 @@ set_call_info(CurrentCallView *view) {
priv->vbox_call_smartInfo);
// init chat view
auto chat_view = chat_view_new(WEBKIT_CHAT_CONTAINER(priv->webkit_chat_container), priv->accountContainer_, priv->conversation_);
gtk_container_add(GTK_CONTAINER(priv->frame_chat), chat_view);
priv->chat_view = chat_view_new(WEBKIT_CHAT_CONTAINER(priv->webkit_chat_container), priv->accountContainer_, priv->conversation_);
gtk_container_add(GTK_CONTAINER(priv->frame_chat), priv->chat_view);
g_signal_connect_swapped(chat_view, "new-messages-displayed", G_CALLBACK(show_chat_view), view);
chat_view_set_header_visible(CHAT_VIEW(chat_view), FALSE);
g_signal_connect_swapped(priv->chat_view, "new-interactions-displayed", G_CALLBACK(show_chat_view), view);
chat_view_set_header_visible(CHAT_VIEW(priv->chat_view), FALSE);
}
......@@ -893,3 +894,11 @@ current_call_view_get_conversation(CurrentCallView *self)
return *priv->conversation_;
}
GtkWidget *
current_call_view_get_chat_view(CurrentCallView *self)
{
g_return_val_if_fail(IS_CURRENT_CALL_VIEW(self), nullptr);
auto priv = CURRENT_CALL_VIEW_GET_PRIVATE(self);
return priv->chat_view;
}
......@@ -53,5 +53,6 @@ GtkWidget *current_call_view_new (WebKitChatContainer* view,
AccountContainer* accountContainer,
lrc::api::conversation::Info* conversation);
lrc::api::conversation::Info current_call_view_get_conversation(CurrentCallView*);
GtkWidget *current_call_view_get_chat_view(CurrentCallView*);
G_END_DECLS
......@@ -259,9 +259,12 @@ change_view(RingMainWindow *self, GtkWidget* old, lrc::api::conversation::Info c
try {
auto contactUri = priv->chatViewConversation_->participants.front();
auto contactInfo = priv->accountContainer_->info.contactModel->getContact(contactUri);
chat_view_update_temporary(CHAT_VIEW(gtk_bin_get_child(GTK_BIN(priv->frame_call))),
contactInfo.profileInfo.type == lrc::api::profile::Type::PENDING
|| contactInfo.profileInfo.type == lrc::api::profile::Type::TEMPORARY);
auto chat_view = current_call_view_get_chat_view(CURRENT_CALL_VIEW(new_view));
if (chat_view) {
chat_view_update_temporary(CHAT_VIEW(chat_view),
contactInfo.profileInfo.type == lrc::api::profile::Type::PENDING
|| contactInfo.profileInfo.type == lrc::api::profile::Type::TEMPORARY);
}
} catch(...) { }
g_signal_connect_swapped(new_view, "video-double-clicked", G_CALLBACK(video_double_clicked), self);
} else if (g_type_is_a(CHAT_VIEW_TYPE, type)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment