Commit 059a62a0 authored by Zach's avatar Zach
Browse files

Merge pull request #689 from Cockatrice/fix-688

Fix #688. Reuse chat tabs when user opens more chat with same user
parents 6e5f4d1f f22e4242
......@@ -371,7 +371,16 @@ TabMessage *TabSupervisor::addMessageTab(const QString &receiverName, bool focus
otherUser = twi->getUserInfo();
else
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 *)));
int tabIndex = myAddTab(tab);
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