forked from blue/squawk
primitive messages receiving
This commit is contained in:
parent
4775c7b700
commit
3cc53dfaf6
15 changed files with 264 additions and 22 deletions
|
@ -184,6 +184,7 @@ void Squawk::onRosterItemDoubleClicked(const QModelIndex& item)
|
|||
connect(conv, SIGNAL(destroyed(QObject*)), this, SLOT(onConversationClosed(QObject*)));
|
||||
|
||||
conversations.insert(std::make_pair(id, conv));
|
||||
rosterModel.dropMessages(account, jid);
|
||||
|
||||
conv->show();
|
||||
}
|
||||
|
@ -201,3 +202,16 @@ void Squawk::onConversationClosed(QObject* parent)
|
|||
}
|
||||
conversations.erase(itr);
|
||||
}
|
||||
|
||||
void Squawk::accountMessage(const QString& account, const QMap<QString, QString>& data)
|
||||
{
|
||||
const QString& from = data.value("from");
|
||||
Conversations::iterator itr = conversations.find({account, from});
|
||||
if (itr != conversations.end()) {
|
||||
qDebug() << "adding message";
|
||||
itr->second->addMessage(data);
|
||||
} else {
|
||||
qDebug() << "pending message";
|
||||
rosterModel.addMessage(account, data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue