EventType.WAVELET_PARTICIPANTS_CHANGED, how do I get the participant that has just been added?

0 views
Skip to first unread message

Wes

unread,
Jan 6, 2010, 3:49:33 AM1/6/10
to Google Wave API
I have browsed through the Wave API and can't seem to find the
function that can get me the name of the just added participant. I'm
trying to create a robot that log who has been added or removed and
when.

Tiago Teixeira

unread,
Jan 6, 2010, 4:06:02 AM1/6/10
to google-...@googlegroups.com
Hi,

First make sure that in the capabilities.xml file you have the line "<w:capability name="WAVELET_PARTICIPANTS_CHANGED" content="true" />" below the "<w:capabilities>" section.
If not, just add it and do not forget to change the version number as well.

When someone is added or removed int the wave the event "WAVELET_PARTICIPANTS_CHANGED" will be triggered.
In java you can use this:

    public void processEvents(RobotMessageBundle bundle) 
    {
        for (Event e: bundle.getEvents())
        {
            if(e.getType() == EventType.WAVELET_PARTICIPANTS_CHANGED) 
            {   
         //Use the folowing functions bellow and get the participants.
         e.getAddedParticipants();
         e.getRemovedParticipants();
        
            }
        }
        
    }

Code is only showing you the methods, you shall iterate through the collection returned by the functions and get the last position of the collection.

HTH,
Teixeira


--
You received this message because you are subscribed to the Google Groups "Google Wave API" group.
To post to this group, send email to google-...@googlegroups.com.
To unsubscribe from this group, send email to google-wave-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.





Wes

unread,
Jan 6, 2010, 5:10:43 AM1/6/10
to Google Wave API
Thanks Telixeira,

I just found that too...

My silly mistake was looking the get functions only after the
getParticipants() in the G sections, even I did a serach, but I didn't
scroll up...

You mentioned do not forget to update the version number, why is that
so important?

cheers,
Wes.

> > google-wave-a...@googlegroups.com<google-wave-api%2Bunsubscribe@ googlegroups.com>

Tiago Teixeira

unread,
Jan 6, 2010, 5:15:43 AM1/6/10
to google-...@googlegroups.com
Hi Wes,

AFAIK, when you changed the capabilities.xml file if you do not change the version number the appengine caches your robot and you might not have the robot behaving like you want.
When you change the version of it, you ensure that wave will use the latest version and not the cached robot. 

Br,
Teixeira

To unsubscribe from this group, send email to google-wave-a...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.






--
Cumprimentos/Best Regards,
Tiago Teixeira

Wes

unread,
Jan 11, 2010, 3:57:00 AM1/11/10
to Google Wave API
Hi Teixeira,

It seems like I can only remove robot participants at the moment! I'm
wondering why is that?
Also, when I removed a robot, there's no event
WAVELET_PARTICIPANTS_CHANGED triggered!
Is that normal?

cheers,
Wes.

> Cumprimentos/Best Regards,
> Tiago Teixeira

pamela (Google Employee)

unread,
Jan 13, 2010, 7:04:42 PM1/13/10
to google-...@googlegroups.com
It currently is not possible in the Wave client to remove
participants, so it is not possible in the API. Once it is possible in
client, it will be in API. Star this issue:
http://code.google.com/p/google-wave-resources/issues/detail?id=403

The second issue may be a bug.

- pamela

> To unsubscribe from this group, send email to google-wave-a...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages