Not logged in. · Lost password · Register
Forum: agsXMPP RSS
C# - .NET 2
Page:  1  2  next
Avatar
Cinska_polivka #1
Member since Nov 2010 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Getting users in GroupChat
Hi, I'm noob in this library and I want to get MUC users in room.
I sucess at connecting bot, gettings messages, respoding to users etc.
I looked in MiniClient, tried that but it's not what I want it says that user changed status / got online.
I want that if someone types something like "!users" bot will give a message with users online.


Thanks a lot, If some topic on this already exists please link me and sorry for my bad english. :)
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
when you have joined a group chat you get all presences ofthe participants in the OnPresence event. In the OnPresence. Use pres.From to detect if this is a group chat presence and to which room the presence belongs. Store the presences in a collection then you will be able to respond to the !users command.

Alex
Avatar
Cinska_polivka #3
Member since Nov 2010 · 2 posts
Group memberships: Members
Show profile · Link to this post
Ok, I will try it, thanks.
Avatar
farhad #4
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #2
Quote by Alex on 2010-11-15, 20:59:
when you have joined a group chat you get all presences ofthe participants in the OnPresence event. In the OnPresence. Use pres.From to detect if this is a group chat presence and to which room the presence belongs. Store the presences in a collection then you will be able to respond to the !users command.

Alex

hello

when i send a request to join a room , OnPresence event gets raised and after entering the capcha it is raised again , why this event raises twice???
Avatar
Alex #5
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I don't understand what you mean. Please post your Xml logs.
Avatar
farhad #6
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
sorry for poor english

how shoul i understand that i have successfully entered a room? ( there is a status code sent by server for wrong captcha but there is not any status code for correct captcha)
i hope u understand me :(
Avatar
Alex #7
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This is why I have asked you for the XML log. In the Xml log i can mark you the presence packet which indicated the join.
Normally its the first presence packet with your room jid.

See also: XEP-0045: Multi-User Chat
Avatar
farhad #8
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
this is the xml that i recieve :

  ----------------------->  after calling  mucManager.JoinRoom(Room, Room.User)  method ,  i recieve this  :  <---------------------

  1. <presence xmlns="jabber:client" from="???????@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="???????@conference.nimbuzz.com/admin" role="moderator" /></x></presence>
  2.  
  3. <presence xmlns="jabber:client" from="???????@conference.nimbuzz.com/p.a.yoooo" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="none" jid="p.a.yoooo@nimbuzz.com/myapp" role="participant" /></x></presence>
  4.  
  5. <iq xmlns="jabber:client" type="error" from="???????@conference.nimbuzz.com" to="p.a.yoooo@nimbuzz.com/myapp" id="agsXMPP_5"><error type="auth" code="403"><forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
  6.  
  7. <message xmlns="jabber:client" type="groupchat" from="???????@conference.nimbuzz.com" to="p.a.yoooo@nimbuzz.com/myapp"><body>Now spend 1000 Nimbuckz to improve your room rank in popular list using the new /boost command. Type /help boost to know more.</body></message>
  8.  
  9. <message xmlns="jabber:client" type="groupchat" from="???????@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp" id="C0AA164F"><body>Enter the right answer to start chatting. http://services.nimbuzz.com/captcha/captcha.php?id=C0AA164F</body><captcha xmlns="nimbuzz:captcha"><x xmlns="jabber:x:data" type="form"><field var="ocr"><media xmlns="urn:xmpp:media-element" height="60" width="180"><uri type="image/jpeg">http://services.nimbuzz.com/captcha/captcha.php?id=C0AA164F</uri><uri type="image/jpeg">cid:sha1+61369aa2f7d5adf5ef890d8762d52a47c0aa164f@bob.xmpp.org</uri></media></field></x></captcha></message>
----------------------------------->    and recieve this xml log after sending captcha to nimbuzz's server : <--------------------------------

  1. <presence xmlns="jabber:client" from="???????@conference.nimbuzz.com/farhad.bluee" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="farhad.bluee@nimbuzz.com/jabbim" role="moderator" /></x></presence>
  2.  
  3. <message xmlns="jabber:client" type="groupchat" from="???????@conference.nimbuzz.com/p.a.yoooo" to="p.a.yoooo@nimbuzz.com/myapp"><body>fn6ac8</body></message>
  4.  
  5. <presence xmlns="jabber:client" type="unavailable" from="???????@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="???????@conference.nimbuzz.com/admin" role="none" /></x></presence>
This post was edited on 2014-06-29, 12:07 by Alex.
Avatar
farhad #9
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
please help :(
Avatar
Alex #10
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
there are lots of question marks in your logs. And I don't know which room you try to join under which nickname.
Without this info I am unable to read your logs.

Alex
Avatar
farhad #11
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
----------------------->  after calling  mucManager.JoinRoom(Room, Room.User)  method ,  i recieve this  :  <---------------------

  1. <presence xmlns="jabber:client" from="farhad@conference.nimbuzz.com/p.a.yoooo" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="none" jid="p.a.yoooo@nimbuzz.com/myapp" role="participant" /></x></presence>
  2.  
  3. <presence xmlns="jabber:client" from="farhad@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="farhad@conference.nimbuzz.com/admin" role="moderator" /></x></presence>
  4.  
  5. <iq xmlns="jabber:client" type="error" from="farhad@conference.nimbuzz.com" to="p.a.yoooo@nimbuzz.com/myapp" id="agsXMPP_5"><error type="auth" code="403"><forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
  6.  
  7. <message xmlns="jabber:client" type="groupchat" from="farhad@conference.nimbuzz.com" to="p.a.yoooo@nimbuzz.com/myapp"><body>Now spend 1000 Nimbuckz to improve your room rank in popular list using the new /boost command. Type /help boost to know more.</body></message>
  8.  
  9. <message xmlns="jabber:client" type="groupchat" from="farhad@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp" id="836EEDC9"><body>Enter the right answer to start chatting. http://services.nimbuzz.com/captcha/captcha.php?id=836EEDC9</body><captcha xmlns="nimbuzz:captcha"><x xmlns="jabber:x:data" type="form"><field var="ocr"><media xmlns="urn:xmpp:media-element" height="60" width="180"><uri type="image/jpeg">http://services.nimbuzz.com/captcha/captcha.php?id=836EEDC9</uri><uri type="image
  10. /jpeg">cid:sha1+70ad1ac3d02aa8b96f74dfca1c73208f836eedc9@bob.xmpp.org</uri></media></field></x></captcha></message>

---------------------------->    and recieve the following xml log after sending captcha to nimbuzz's server : <--------------------------------

  1. <presence xmlns="jabber:client" from="farhad@conference.nimbuzz.com/farhad.bluee" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="farhad.bluee@nimbuzz.com/nimbuzzdesktop526" role="moderator" /></x></presence>
  2.  
  3. <message xmlns="jabber:client" type="groupchat" from="farhad@conference.nimbuzz.com/p.a.yoooo" to="p.a.yoooo@nimbuzz.com/myapp"><body>f3k6n</body></message>
  4.  
  5. <presence xmlns="jabber:client" type="unavailable" from="farhad@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="farhad@conference.nimbuzz.com/admin" role="none" /></x></presence>
This post was edited 2 times, last on 2014-06-29, 12:46 by Alex.
Avatar
Alex #12
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I need the complete logs. What you send to join the room, what you receive. The room name and your chosen nickame
Avatar
farhad #13
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
Room Jid is : farhad@conference.nimbuzz.com

this is the code i wrote to join the room :

  1. mucManager = new MucManager(c);
  2. Jid Room = new Jid(textBox1.Text + "@conference.nimbuzz.com");
  3. mucManager.JoinRoom(Room, Room.User);
  4. mucManager.AcceptDefaultConfiguration(Room);


and use following code to send captcha characters to server:

  1. c.Send(new agsXMPP.protocol.client.Message(textBox1.Text + "@conference.nimbuzz.com",MessageType.groupchat,textBox6.Text));

and this is Xml log :

  1. <presence to="farhad@conference.nimbuzz.com/farhad"><x xmlns="http://jabber.org/protocol/muc" /></presence>
  2.  
  3. <iq id="agsXMPP_5" type="set" to="farhad@conference.nimbuzz.com"><query xmlns="http://jabber.org/protocol/muc#owner"><x xmlns="jabber:x:data" type="submit" /></query></iq>
  4.  
  5. <presence xmlns="jabber:client" from="farhad@conference.nimbuzz.com/p.a.yoooo" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="none" jid="p.a.yoooo@nimbuzz.com/myapp" role="participant" /></x></presence>
  6.  
  7. <presence xmlns="jabber:client" from="farhad@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="farhad@conference.nimbuzz.com/admin" role="moderator" /></x></presence>
  8.  
  9. <iq xmlns="jabber:client" type="error" from="farhad@conference.nimbuzz.com" to="p.a.yoooo@nimbuzz.com/myapp" id="agsXMPP_5"><error type="auth" code="403"><forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
  10.  
  11. <message xmlns="jabber:client" type="groupchat" from="farhad@conference.nimbuzz.com" to="p.a.yoooo@nimbuzz.com/myapp"><body>Now spend 1000 Nimbuckz to improve your room rank in popular list using the new /boost command. Type /help boost to know more.</body></message>
  12.  
  13. <message xmlns="jabber:client" type="groupchat" from="farhad@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp" id="48CF9550"><body>Enter the right answer to start chatting. http://services.nimbuzz.com/captcha/captcha.php?id=48CF9550</body><captcha xmlns="nimbuzz:captcha"><x xmlns="jabber:x:data" type="form"><field var="ocr"><media xmlns="urn:xmpp:media-element" height="60" width="180"><uri type="image/jpeg">http://services.nimbuzz.com/captcha/captcha.php?id=48CF9550</uri><uri type="image/jpeg">cid:sha1+52f78e8f8ff8cc55e0437a13769c71a848cf9550@bob.xmpp.org</uri></media></field></x></captcha></message>
  14.  
  15. <message to="farhad@conference.nimbuzz.com" type="groupchat"><body>xdamc8</body></message>
  16.  
  17. <presence xmlns="jabber:client" from="farhad@conference.nimbuzz.com/farhad.bluee" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="farhad.bluee@nimbuzz.com/nimbuzzdesktop526" role="moderator" /></x></presence>
  18.  
  19. <message xmlns="jabber:client" type="groupchat" from="farhad@conference.nimbuzz.com/p.a.yoooo" to="p.a.yoooo@nimbuzz.com/myapp"><body>xdamc8</body></message>
  20.  
  21. <presence xmlns="jabber:client" type="unavailable" from="farhad@conference.nimbuzz.com/admin" to="p.a.yoooo@nimbuzz.com/myapp"><x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" jid="farhad@conference.nimbuzz.com/admin" role="none" /></x></presence>
This post was edited 2 times, last on 2014-06-29, 14:52 by Alex.
Avatar
Alex #14
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sorry but I have no idea what's going on in your log.

It look to me like you join the room farhad (jid=farhad@conference.nimbuzz.com) and the username is as well farhad.
but the server returns presences with usernames:

  • p.a.yoooo
  • admin
  • farhad.bluee

there is no presence with the username farhad

it looks like the server ignores your username, and Nimbuzz does not follow the MUC specs and have their own modifications of it.
I guess you have to ask the Nimbuzz developers directly or somebody who has worked with this service before (I haven't).
Avatar
farhad #15
Member since Jun 2014 · 10 posts
Group memberships: Members
Show profile · Link to this post
Ok . thank you alot.
but farhad is room name.
owner of the room is farhad.bluee
and i want to join the room as p.a.yoooo
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:
Page:  1  2  next
Forum: agsXMPP RSS