aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/GuiClient/mainDialog.cpp13
-rw-r--r--examples/GuiClient/mainDialog.h1
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);