Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
javanesevn #1
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Subject: Rosters have same pre-define group
Dear all,

When user login, he/she has the same group. It seems this function will be implemented on xmpp server side, isn't it?
Could I implement this function client side for send broadcast message to all members belong a group?

Best regards,
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
no, thee is nothing like this in XMPP servers today.
You have to create a single message for every contact in the group. You should be able to loop through all contact of a specific group with your roster UI control.

If your server supports XEP-0033 extended stanza addressing you can also create one message with multiple recipients.

Alex
Avatar
javanesevn #3
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Thank you very much Alex.

In case, If I would like to change group name, how can I force change group name to all contact belong that group?

Best,

Le
This post was edited on 2008-07-02, 11:52 by javanesevn.
Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
same as with message. You have to change the group of each rosteritem which belongs to this group.

Alex
Avatar
javanesevn #5
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Dear Alex,

Openfire server has supported this case by shared-group feature.
Basically, group is part of roster and this is work-around to add all roster to themselves. I think this feature implement on server side is better.

Best


Le
Avatar
Alex #6
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I know that you can do this in Openfire in the web admin console. But I don't think openfire has xmpp extensions for this.
Let me know if there is something I am not aware of.

Alex
Avatar
javanesevn #7
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
Dear Alex,

Thank you for your support.
Follow in shared-group feature from Openfire server. I try with some clients xmpp but contact list is very different.

Here is log from MiniClient:

SEND: <stream:stream to='fedoracore9' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="fedoracore9" version="1.0" xml:lang="en" id="a9aea187" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" /><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><auth xmlns="http://jabber.org/features/iq-auth" /></stream:features>
SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
SEND: <stream:stream to='fedoracore9' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="fedoracore9" version="1.0" xml:lang="en" id="a9aea187" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><auth xmlns="http://jabber.org/features/iq-auth" /></stream:features>
SEND: <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="DIGEST-MD5" />
RECV: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cmVhbG09Iml2eS1hcnRzLm5ldCIsbm9uY2U9Ijg4V2FiQlRaQVljL1ZGY0tqTWJyZzhOclJrS0Y0VjVRdEREVS8yS2ciLHFvcD0iYXV0aCIsY2hhcnNldD11dGYtOCxhbGdvcml0aG09bWQ1LXNlc3M=</challenge>
SEND: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Inlhbm8iLHJlYWxtPSJpdnktYXJ0cy5uZXQiLG5vbmNlPSI4OFdhYkJUWkFZYy9WRmNLak1icmc4TnJSa0tGNFY1UXRERFUvMktnIixjbm9uY2U9IjQ4ZmIxMmNhMjlhNjI5ZDcwNGNjZjM5YzQ0MzM0ZDQ1ZTM1MjI3ZTA2NDFmOWQ1MWE2ZDIxNGRlNjE3Y2IxY2YiLG5jPTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvaXZ5LWFydHMubmV0IixjaGFyc2V0PXV0Zi04LHJlc3BvbnNlPWNiNDUwZTFhZThmODVjYzdiM2QxYjRjOTQ3ODg2NjY1</response>
RECV: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cnNwYXV0aD00N2FmMGE2NTAyZWExMzJlMmRiZTY2YTk5MzI0ODVlOA==</success>
SEND: <stream:stream to='fedoracore9' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="fedoracore9" version="1.0" xml:lang="en" id="a9aea187" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" /><session xmlns="urn:ietf:params:xml:ns:xmpp-session" /></stream:features>
SEND: <iq id="agsXMPP_1" type="set" to="fedoracore9"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><resource>MiniClient</resource></bind></iq>
RECV: <iq xmlns="jabber:client" from="fedoracore9" to="fedoracore9/a9aea187" type="result" id="agsXMPP_1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>yano@fedoracore9/MiniClient</jid></bind></iq>
SEND: <iq id="agsXMPP_2" type="set" to="fedoracore9"><session xmlns="urn:ietf:params:xml:ns:xmpp-session" /></iq>
RECV: <iq xmlns="jabber:client" from="fedoracore9" to="yano@fedoracore9/MiniClient" type="result" id="agsXMPP_2"><session xmlns="urn:ietf:params:xml:ns:xmpp-session" /></iq>
SEND: <iq id="agsXMPP_5" type="get" to="fedoracore9"><query xmlns="http://jabber.org/protocol/disco#items" /></iq>
SEND: <iq id="agsXMPP_3" type="get" to="fedoracore9"><query xmlns="jabber:iq:agents" /></iq>
SEND: <iq id="agsXMPP_4" type="get"><query xmlns="jabber:iq:roster" /></iq>
RECV: <iq xmlns="jabber:client" from="fedoracore9" to="yano@fedoracore9/MiniClient" type="error" id="agsXMPP_3"><query xmlns="jabber:iq:agents" /><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
RECV: <iq xmlns="jabber:client" to="yano@fedoracore9/MiniClient" type="result" id="agsXMPP_4">
        <query xmlns="jabber:iq:roster">
            <item name="user1" jid="user1@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>NetGroup</group>
            </item>
            <item name="user2" jid="user2@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>HRGroup</group></item>
            <item name="user3" jid="user3@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>NetGroup</group>
            </item>
            <item name="user4" jid="user4@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>NetGroup</group>
            </item>
            <item name="user5" jid="user5@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>HRGroup</group>
            </item>
        </query>
      </iq>

Result: just User1 is online
       Online:
           CompGroup: user1
       Offline:
           CompGroup: user2, user3, user4, user5


Here is not complete log from Spark:

<iq id="qfR97-2" to="yano@fedoracore9/sparkx" type="result">
  <query xmlns="jabber:iq:roster">
                      <item name="user1" jid="user1@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>NetGroup</group>
            </item>
            <item name="user2" jid="user2@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>HRGroup</group></item>
            <item name="user3" jid="user3@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>NetGroup</group>
            </item>
            <item name="user4" jid="user4@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>NetGroup</group>
            </item>
            <item name="user5" jid="user5@fedoracore9" subscription="both">
                <group>CompGroup</group>
                <group>HRGroup</group>
            </item>
        </query>
   </iq>
     
  Result: just User1 online
       - CompGroup
            user1 (online)
       - NetGroup
            user1 (online)
       - HRGroup
            (no user in this list)
       - Offline  Group
            user 2, user 3, user4, user 5 (offline)

Pidgin have the same result as Spark client

At MiniClient can not display NetGroup and HRGroup although user online or offline. Does I need implement addition XEP for displaying contact list as Spark or Pidgin?


Best regards,

Le
Avatar
Alex #8
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
MiniClient and the underlaying roster control displays only the 1st group.
You have to create your own roster control or extend the one in MiniClient to display all groups.
agsXMPP gives you all groups in the OnRosterItem event.

Allex
Avatar
javanesevn #9
Member since Apr 2008 · 74 posts · Location: Japan
Group memberships: Members
Show profile · Link to this post
I appreciate your help. :)
Avatar
Alex #10
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  1. string groupname;
  2. if (ritem.GetGroups().Count > 0)
  3. {
  4.     Group g = (Group)ritem.GetGroups().Item(0);
  5.     groupname = g.Name;
  6. }
  7. else
  8. {
  9.     groupname = m_DefaultGroupName;
  10. }

this is the code from rostercontrol.cs. You can see that it used the first group if groups are available, or a default groupname if no groups are available. You can iterate all groups with GetGroups(), but this adds much more complexity to your roster drawing and presence code.

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: agsXMPP RSS