Skip to content

Commit

Permalink
Always ignore resource in findDialog unless it's a MUC's private chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Jun 30, 2024
1 parent 3d64d67 commit 89b5898
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/chatdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void ChatDlg::init()
connect(account(), SIGNAL(pgpKeyChanged()), SLOT(updatePgp()));
connect(account(), SIGNAL(encryptedMessageSent(int, bool, int, const QString &)),
SLOT(encryptedMessageSent(int, bool, int, const QString &)));
account()->dialogRegister(this, jid());
account()->dialogRegister(this, isPrivate ? jid() : jid().withResource({}));

chatView()->setFocusPolicy(Qt::NoFocus);
chatEdit()->setFocus();
Expand Down Expand Up @@ -375,7 +375,8 @@ void ChatDlg::setJid(const Jid &j)
account()->dialogUnregister(this);
TabbableWidget::setJid(j);
updateRealJid();
account()->dialogRegister(this, jid());
bool isPrivate = account()->groupchats().contains(jid().bare());
account()->dialogRegister(this, isPrivate ? jid() : jid().withResource({}));
updateContact(jid(), false);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/chatview_webkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class ChatViewPrivate {
void sendReactionsToUI(const QString &nick, const QString &messageId, const QSet<QString> &reactions)
{
QVariantMap m;
// m["type"] = "message";
m["type"] = QLatin1String("reactions");
m["sender"] = nick;
m["messageid"] = messageId;
Expand Down
1 change: 1 addition & 0 deletions src/psiaccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3450,6 +3450,7 @@ ChatDlg *PsiAccount::findChatDialogEx(const Jid &jid, bool ignoreResource) const
ChatDlg *cm1 = nullptr;
ChatDlg *cm2 = nullptr;
const auto &dialogs = findChatDialogs(jid, false);
ignoreResource = ignoreResource || !d->groupchats.contains(jid.bare());
for (ChatDlg *cl : dialogs) {
if (cl->autoSelectContact() || ignoreResource)
return cl;
Expand Down

0 comments on commit 89b5898

Please sign in to comment.