diff options
| author | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-09-28 16:03:43 +0000 |
|---|---|---|
| committer | Manjeet Dahiya <manjeetdahiya@gmail.com> | 2010-09-28 16:03:43 +0000 |
| commit | 97c57b6463e094e934b5fe460201dcf1b169f1be (patch) | |
| tree | c69a3952627693d546d88adcd517c17ec56600f7 /examples/GuiClient | |
| parent | bf24668d95a652af3c0e375b105e1667b2e25ae3 (diff) | |
| download | qxmpp-97c57b6463e094e934b5fe460201dcf1b169f1be.tar.gz | |
add remove contact functionality
Diffstat (limited to 'examples/GuiClient')
| -rw-r--r-- | examples/GuiClient/mainDialog.cpp | 13 | ||||
| -rw-r--r-- | examples/GuiClient/mainDialog.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/examples/GuiClient/mainDialog.cpp b/examples/GuiClient/mainDialog.cpp index 75b74424..d6c8e24b 100644 --- a/examples/GuiClient/mainDialog.cpp +++ b/examples/GuiClient/mainDialog.cpp @@ -738,3 +738,16 @@ void mainDialog::presenceReceived(const QXmppPresence& presence) QMessageBox::information(this, "Contact Subscription", message.arg(from), QMessageBox::Ok); } + +void mainDialog::action_removeContact(const QString& bareJid) +{ + // TODO: check valid bareJid + + QXmppRosterIq remove; + remove.setType(QXmppIq::Set); + QXmppRosterIq::Item itemRemove; + itemRemove.setSubscriptionType(QXmppRosterIq::Item::Remove); + itemRemove.setBareJid(bareJid); + remove.addItem(itemRemove); + m_xmppClient.sendPacket(remove); +} diff --git a/examples/GuiClient/mainDialog.h b/examples/GuiClient/mainDialog.h index 672580d8..1e3252a0 100644 --- a/examples/GuiClient/mainDialog.h +++ b/examples/GuiClient/mainDialog.h @@ -86,6 +86,7 @@ private slots: void presenceReceived(const QXmppPresence&); void action_addContact(); + void action_removeContact(const QString& bareJid); void action_signOut(); void action_quit(); void action_trayIconActivated(QSystemTrayIcon::ActivationReason reason); |
