Subject: How do I confirm my subscriptions correctly?
Hi everybody, I use agsXmpp library, I get many ask subscribe:
and I try to confirm all of that (see code under),
but it doesn't work, I get subscribe many times.
How do I confirm my subscriptions correctly?
- <iq xmlns="jabber:client" from="testz2@mx.testserverz.info" to="testz2@mx.testserverz.info/agsXMPP" type="result" id="agsXMPP_5" xml:lang="en">
- <query xmlns="jabber:iq:roster">
- <item jid="testy@mx.testserverz.info" ask="subscribe" />
- <item ask="subscribe" name="testz2@mx.testserverz.info" jid="testz2@mx.testserverz.info"><group>Friends</group></item>
- <item jid="testconfaconference.mx.testserverz.info" ask="subscribe" />
- <item jid="testconfa@conference.mx.testserverz.info" ask="subscribe" />
- <item jid="testconfa223122019164645@conference.mx.testserverz.info" ask="subscribe" />
- <item jid="testconfa223122019165017@conference.mx.testserverz.info" ask="subscribe" />
- <item jid="testconfa223122019172125@conference.mx.testserverz.info" ask="subscribe" />
- <item jid="testconfa22312201917364@conference.mx.testserverz.info" ask="subscribe" />
- </query>
- </iq>
and I try to confirm all of that (see code under),
but it doesn't work, I get subscribe many times.
How do I confirm my subscriptions correctly?
- ...
- private void xmpp_OnRosterItem(object sender, RosterItem item)
- {
- if (item == null) return;
- if (item.Ask == AskType.subscribe)
- {
- PubSub_anySubscribe(item.Jid);
- }
- ...
- }
- private void PubSub_anySubscribe(Jid jid)
- {
- try
- {
- if (jid == null) return;
- pm.Subcribe(jid);
- }
- catch (Exception exp)
- {
- var s = exp.Message;
- }
- }
This post was edited on 2019-12-29, 23:15 by Alex.