ui logick of changing message, not connected yet

This commit is contained in:
Blue 2020-02-08 14:44:15 +03:00
parent ed56cca2e7
commit 6d1b83d0f8
18 changed files with 246 additions and 19 deletions

View file

@ -480,9 +480,9 @@ void Squawk::accountMessage(const QString& account, const Shared::Message& data)
QApplication::alert(conv);
if (conv->isMinimized()) {
rosterModel.addMessage(account, data);
if (!data.getForwarded()) {
notify(account, data);
}
}
if (!conv->isVisible() && !data.getForwarded()) {
notify(account, data);
}
} else {
rosterModel.addMessage(account, data);
@ -493,6 +493,20 @@ void Squawk::accountMessage(const QString& account, const Shared::Message& data)
}
}
void Squawk::changeMessage(const QString& account, const QString& jid, const QString& id, const QMap<QString, QVariant>& data)
{
Conversations::iterator itr = conversations.find({account, jid});
if (itr != conversations.end()) {
Conversation* conv = itr->second;
conv->changeMessage(id, data);
if (conv->isMinimized()) {
rosterModel.changeMessage(account, jid, id, data);
}
} else {
rosterModel.changeMessage(account, jid, id, data);
}
}
void Squawk::notify(const QString& account, const Shared::Message& msg)
{
QString name = QString(rosterModel.getContactName(account, msg.getPenPalJid()));