diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-13 10:26:39 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-13 10:26:39 +0200 |
| commit | b0fc7dca8d21e7f8e507299c860912799a41a308 (patch) | |
| tree | 06a599498b672f6b564fbf3bcaa758ee22cf627e /examples/GuiClient | |
| parent | 13794e15896df75fb013a300de976e7f4d23debe (diff) | |
| download | qxmpp-b0fc7dca8d21e7f8e507299c860912799a41a308.tar.gz | |
don't show empty messages
Diffstat (limited to 'examples/GuiClient')
| -rw-r--r-- | examples/GuiClient/mainDialog.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp index 714a0331..07895a65 100644 --- a/examples/GuiClient/mainDialog.cpp +++ b/examples/GuiClient/mainDialog.cpp @@ -355,9 +355,14 @@ void mainDialog::showChatDialog(const QString& bareJid) void mainDialog::messageReceived(const QXmppMessage& msg) { - QString from = msg.from(); - getChatDialog(QXmppUtils::jidToBareJid(from))->show(); - getChatDialog(QXmppUtils::jidToBareJid(from))->messageReceived(msg.body()); + if (msg.body().isEmpty()) + return; + + chatDialog *dialog = getChatDialog(QXmppUtils::jidToBareJid(msg.from())); + if (dialog) { + dialog->show(); + dialog->messageReceived(msg.body()); + } } void mainDialog::statusTextChanged(const QString& status) |
