Commit f22e4242 authored by Gavin Bises's avatar Gavin Bises
Browse files

Fix #688. Reuse chat tabs when user opens more chat with same user

parent 25cc6951
...@@ -371,7 +371,16 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus ...@@ -371,7 +371,16 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus
otherUser = twi->getUserInfo(); otherUser = twi->getUserInfo();
else else
otherUser.set_name(receiverName.toStdString()); otherUser.set_name(receiverName.toStdString());
TabMessage *tab = new TabMessage(this, client, *userInfo, otherUser);
TabMessage *tab;
tab = messageTabs.value(QString::fromStdString(otherUser.name()));
if (tab) {
if (focus)
setCurrentWidget(tab);
return tab;
}
tab = new TabMessage(this, client, *userInfo, otherUser);
connect(tab, SIGNAL(talkClosing(TabMessage *)), this, SLOT(talkLeft(TabMessage *))); connect(tab, SIGNAL(talkClosing(TabMessage *)), this, SLOT(talkLeft(TabMessage *)));
int tabIndex = myAddTab(tab); int tabIndex = myAddTab(tab);
addCloseButtonToTab(tab, tabIndex); addCloseButtonToTab(tab, tabIndex);
......
Supports Markdown
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