Commit d81f6efa authored by Sébastien Blin's avatar Sébastien Blin

incomingcallview: fix display for let a message view

Change-Id: Ia3d43adbb6be90d086e24ff1ba13cf231b9e4870
parent add48f2a
......@@ -73,6 +73,7 @@ struct _IncomingCallViewPrivate
GtkWidget *frame_chat;
GtkWidget *box_messaging_widget;
GtkWidget *messaging_widget;
bool showMessaging {false};
// The webkit_chat_container is created once, then reused for all chat views
GtkWidget *webkit_chat_container;
......@@ -161,6 +162,7 @@ on_leave_action(IncomingCallView *view)
{
g_return_if_fail(IS_INCOMING_CALL_VIEW(view));
auto priv = INCOMING_CALL_VIEW_GET_PRIVATE(view);
priv->showMessaging = false;
(*priv->accountInfo_)->conversationModel->selectConversation(priv->conversation_->uid);
}
......@@ -349,5 +351,15 @@ incoming_call_view_let_a_message(IncomingCallView* view, lrc::api::conversation:
gtk_widget_hide(priv->button_accept_incoming);
gtk_widget_hide(priv->button_reject_incoming);
priv->showMessaging = true;
gtk_widget_show(priv->messaging_widget);
}
bool
is_showing_let_a_message_view(IncomingCallView* view, lrc::api::conversation::Info conv)
{
g_return_val_if_fail(IS_INCOMING_CALL_VIEW(view), false);
auto priv = INCOMING_CALL_VIEW_GET_PRIVATE(view);
g_return_val_if_fail(priv->conversation_->uid == conv.uid, false);
return priv->showMessaging;
}
......@@ -59,6 +59,7 @@ GtkWidget *incoming_call_view_new (WebKitChatContainer* view,
AccountInfoPointer const & accountInfo,
lrc::api::conversation::Info* conversation);
void incoming_call_view_let_a_message(IncomingCallView* view, lrc::api::conversation::Info conv);
bool is_showing_let_a_message_view(IncomingCallView* view, lrc::api::conversation::Info conv);
lrc::api::conversation::Info incoming_call_view_get_conversation (IncomingCallView*);
G_END_DECLS
......@@ -2361,9 +2361,12 @@ CppImpl::slotConversationRemoved(const std::string& uid)
void
CppImpl::slotShowChatView(const std::string& id, lrc::api::conversation::Info origin)
{
auto* old_view = gtk_bin_get_child(GTK_BIN(widgets->frame_call));
if (IS_INCOMING_CALL_VIEW(old_view) && is_showing_let_a_message_view(INCOMING_CALL_VIEW(old_view), origin)) {
return;
}
changeAccountSelection(id);
// Show chat view if not in call (unless if it's the same conversation)
auto* old_view = gtk_bin_get_child(GTK_BIN(widgets->frame_call));
lrc::api::conversation::Info current_item;
current_item.uid = "-1";
if (IS_CHAT_VIEW(old_view))
......
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