Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
burkan #1
Member since Nov 2012 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: when kicked or banned from groupchat
hey all ... i want know when me or any one else has been kick from the room >> or Banned

i have make this code but not working :(

If pres.Type = x.muc.StatusCode.ConfigurationChanged Then
               
                MsgBox("ConfigurationChanged ")
 
            End If
            If pres.Type = x.muc.StatusCode.Banned Then
                If pres.From.Resource = id.Text Then
                    msgbox("YOU BANNED")
                End If
            End If
            If pres.Type = x.muc.StatusCode.Kicked Then
                If pres.From.Resource = id.Text Then
                    msgbox("YOU ARE KICK")
                End If
            End If


alse when ConfigurationChanged  not showig msgbox ??? any help ?

im using vb.net to that ... its oky if you help me from giving csharp i understand
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
pres.Type is something totally different.

The xml looks like that:
  1. <presence from="dev@conference.ag-software.de/AlexPsi" to="gnauck@ag-software.de/W7-Gnauck">
  2. <x xmlns="http://jabber.org/protocol/muc#user">
  3.    <item affiliation="owner" role="moderator" jid="gnauck@ag-software.de/W7-Gnauck"/>
  4.    <status code="110"/>
  5. </x>
  6. </presence>

you need the status tag embedded in the x tag. Here is some example code how we use it normally:

  1. var xUser = pres.MucUser;
  2. if (xUser != null)
  3. {
  4.     if (xUser.HasStatus(110))
  5.     {
  6.        // do something
  7.     }
  8.  
  9.     if (xUser.HasStatus(201))
  10.     {
  11.         // 201, Inform user that a new room has been created
  12.         // do something
  13.     }
  14. }

Alex
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