Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
mwaqas #1
Member since Mar 2012 · 10 posts · Location: Finland
Group memberships: Members
Show profile · Link to this post
Subject: how to use XEP-0191
Moi,

How I can use XEP-0191, basically get the list of blocked contacts and block/unblock contacts.

Thanks,
-Waqas
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Here are some code snippets, please let me know if it helps:

Get Blocking list:
  1. var iq = new IqQuery<Matrix.Xmpp.Blocking.Blocklist>()
  2. {
  3.     Type = IqType.get,
  4. };
  5. Console.WriteLine(iq.ToString());

block romeo@montague.net:
  1. var iq = new IqQuery<Matrix.Xmpp.Blocking.Block>()
  2. {
  3.     Type = IqType.set,
  4. };
  5. iq.Query.AddItem(new Matrix.Xmpp.Blocking.Item() { Jid = "romeo@montague.net" });
  6. Console.WriteLine(iq.ToString());

unblock romeo@montague.net:
  1. var iq = new IqQuery<Matrix.Xmpp.Blocking.Unblock>()
  2. {
  3.     Type = IqType.set,
  4. };
  5. iq.Query.AddItem(new Matrix.Xmpp.Blocking.Item() {Jid = "romeo@montague.net"});
  6. Console.WriteLine(iq.ToString());

Send these Iqs with the new TAP pattern (async await) or the IqFilters, whatever you prefer.

Alex
Avatar
mwaqas #3
Member since Mar 2012 · 10 posts · Location: Finland
Group memberships: Members
Show profile · Link to this post
Hello Alex,

Thanks for your reply. I am using latest build 1.5.2.4. I am unable to find Matrix.Xmpp.Blocking namespace. Should I use Matrix from latest stable builds?

-Waqas
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by mwaqas:
Should I use Matrix from latest stable builds?
yes you should.

Alex
Avatar
mwaqas #5
Member since Mar 2012 · 10 posts · Location: Finland
Group memberships: Members
Show profile · Link to this post
so is it safe to use latest stable builds in production software?

-Waqas
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes, always. All binary binary builds we uploaded are well tested and passed all our unit tests.
We don't update the complete download package that often, so I suggest always to use the latest binary.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS