powered by Jive Software

Add User to group

Hi,

I wanted to know how i can add users to group after i’'ve got the org.jivesoftware.messenger.user.User object.

I’'m creating users automaticlly (via getUserManage().addUser(…) method) ,

and i couldn’'t find how to add users to a group…

i’'ve tried through GroupManager and no luck so far

can anyone help?

Cheers,

Yoni.

Message was edited by:

yonim

Found it

Hi Yoni,

You were on the right track with looking at the GroupManager. Try something like this:

GroupManager groupManager = GroupManager.getInstance();

Group group = groupManager.getGroup(“group”);

group.getMembers().add(user.getUsername());

/code

Hope that helps,

Ryan

Hi Ryan ,

That was fast

10x, I was just downloading the src for jive and i saw the same code

at the group-edit.jsp

10x again,

Yoni.

Yoni,

Don’'t forget to close the question and award Ryan some points!

-Matt

A post was split to a new topic: Groups created in converse.js disappear after log out