From 97c57b6463e094e934b5fe460201dcf1b169f1be Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Tue, 28 Sep 2010 16:03:43 +0000 Subject: add remove contact functionality --- examples/GuiClient/mainDialog.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'examples/GuiClient/mainDialog.cpp') 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); +} -- cgit v1.2.3