Commit 37da856e authored by Sébastien Blin's avatar Sébastien Blin

currentcallview: reload view if different callId rendered

Change-Id: I21a0b1588140ed1a03556b07f933e2d192a88430
parent 5613a0b6
......@@ -251,6 +251,8 @@ public:
std::vector<std::string> titles_;
std::set<std::string> hiddenTitles_;
std::string currentCall_ {};
private:
CppImpl() = delete;
CppImpl(const CppImpl&) = delete;
......@@ -1189,6 +1191,7 @@ CppImpl::setCallInfo()
if (!conversation->confId.empty())
callToRender = conversation->confId;
currentCall_ = callToRender;
try {
// local renderer
const lrc::api::video::Renderer* previewRenderer =
......@@ -1652,6 +1655,17 @@ current_call_view_get_chat_view(CurrentCallView *self)
return priv->chat_view;
}
std::string
current_call_view_get_rendered_call(CurrentCallView* view)
{
g_return_val_if_fail(IS_CURRENT_CALL_VIEW(view), "");
auto* priv = CURRENT_CALL_VIEW_GET_PRIVATE(view);
if (!priv->cpp) return {};
return priv->cpp->currentCall_;
}
void
current_call_view_show_chat(CurrentCallView* view)
{
......
......@@ -59,6 +59,7 @@ GtkWidget *current_call_view_new (WebKitChatContainer* view,
const lrc::api::Lrc& lrc);
lrc::api::conversation::Info current_call_view_get_conversation(CurrentCallView*);
GtkWidget *current_call_view_get_chat_view(CurrentCallView*);
std::string current_call_view_get_rendered_call(CurrentCallView*);
void current_call_view_show_chat(CurrentCallView*);
void current_call_view_handup_focus(GtkWidget *current_call_view);
......
......@@ -2415,8 +2415,12 @@ CppImpl::slotShowCallView(const std::string& id, lrc::api::conversation::Info or
if (IS_CURRENT_CALL_VIEW(old_view))
current_item = current_call_view_get_conversation(CURRENT_CALL_VIEW(old_view));
if (origin.uid == current_item.uid && IS_CURRENT_CALL_VIEW(old_view))
return;
if (IS_CURRENT_CALL_VIEW(old_view) && origin.uid == current_item.uid) {
auto rendered = current_call_view_get_rendered_call(CURRENT_CALL_VIEW(old_view));
auto sameCall = origin.confId.empty() ? origin.callId == rendered : origin.confId == rendered;
if (sameCall)
return;
}
changeView(CURRENT_CALL_VIEW_TYPE, origin);
}
......
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