Fix #688. Reuse chat tabs when user opens more chat with same user
This commit is contained in:
parent
25cc695190
commit
f22e42428c
1 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue