basic sending messages

This commit is contained in:
Blue 2019-04-10 23:53:42 +03:00
parent d3f537856f
commit 5575cff1f5
14 changed files with 103 additions and 3 deletions

View file

@ -182,6 +182,7 @@ void Squawk::onRosterItemDoubleClicked(const QModelIndex& item)
conv->setAttribute(Qt::WA_DeleteOnClose);
connect(conv, SIGNAL(destroyed(QObject*)), this, SLOT(onConversationClosed(QObject*)));
connect(conv, SIGNAL(sendMessage(const QString&)), this, SLOT(onConversationMessage(const QString&)));
conversations.insert(std::make_pair(id, conv));
rosterModel.dropMessages(account, jid);
@ -215,3 +216,12 @@ void Squawk::accountMessage(const QString& account, const QMap<QString, QString>
rosterModel.addMessage(account, data);
}
}
void Squawk::onConversationMessage(const QString& item)
{
Conversation* conv = static_cast<Conversation*>(sender());
emit sendMessage(conv->getAccount(), {
{"to", conv->getJid()},
{"body", item}
});
}