Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
glory209 #1
Member since Aug 2006 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: Block GTalk contact
Can you show me way to block GTalk contact. I found in class using agsXMPP.protocol.iq.privacy.RuleManager but can't used it.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

the class you refer to belongs to privacy lists which are/were in the XMPP core. Using privacy lists you can set rules to block or allow communications. Privacy lists need server side support. And there are not many existing servers which support them. Is you use the GTalk server then i don't think you can use this feature. AFAIK the GTalk server has no support for privacy lists.
What you can so is store a local list of contacts you want to block. Then check all incoming stanzas against this list.

  1. foreach (string blockedContact in BlockedContacts)
  2. {
  3.     if (packet.From.Bare == blockedContact)
  4.     {
  5.         // ignore this packet
  6.         return;
  7.     }      
  8. }

Alex

PS: Privacy lists will be removed from the XMPP core, because they were to complex for the most developers. The JSF is working on new extensions for communications blocking which you will find in the XEP list.
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: agsXMPP RSS