mod_groups contacts not showing up on roster

2,206 views
Skip to first unread message

Adam Nielsen

unread,
Oct 5, 2011, 4:21:50 AM10/5/11
to prosod...@googlegroups.com
Hi all,

I'm in the process of setting up Prosody to try out instead of jabberd2.
So far everything is working well (and much more straightforward than
with jabberd2) but I'm a bit stuck trying to get mod_groups working -
none of the shared contacts appear on the roster.

My config file says:

modules_enabled = {
"groups"; -- Enable shared groups
}
groups_file = "/var/lib/prosody/shared_groups.ini"

That file exists and is in .ini format:

[Some Group]
jid@domain=Some Name

This seems to work according to the Prosody log file:

Oct 05 18:07:25 mydomain:groups info Groups loaded successfully

However in my contact list I can only see the self contact. I expected
to see all the shared users as offline.

Is there any particular trick to getting this going?

Many thanks,
Adam.

Matthew Wild

unread,
Oct 5, 2011, 4:50:11 AM10/5/11
to prosod...@googlegroups.com
Hi Adam,

On 5 October 2011 09:21, Adam Nielsen <adam.n...@uq.edu.au> wrote:
> Hi all,
>
> I'm in the process of setting up Prosody to try out instead of jabberd2.  So
> far everything is working well (and much more straightforward than with
> jabberd2) but I'm a bit stuck trying to get mod_groups working - none of the
> shared contacts appear on the roster.
>

Possibly one place I can think it might be going wrong... mod_groups
is not the same as jabberd2's roster population. You must be listed in
a group to see everyone else in a group.

We're working on supporting alternative functionality, e.g. making a
group of JIDs visible to everyone on the server. Unfortunately it's
tricky and we haven't finished yet. You can track progress at
http://prosody.im/bugs/167

If you're looking for something more similar to jabberd2's roster
population, you might be after mod_support_contact:
http://code.google.com/p/prosody-modules/wiki/mod_support_contact
(perhaps with support for multiple JIDs?).

Hope this helps... and if I'm barking up completely the wrong tree
about your problem, let me know :)

Regards,
Matthew

Adam Nielsen

unread,
Oct 5, 2011, 5:03:11 AM10/5/11
to prosod...@googlegroups.com
Hi Matthew,

Thanks for the quick reply!

> Possibly one place I can think it might be going wrong... mod_groups
> is not the same as jabberd2's roster population. You must be listed in
> a group to see everyone else in a group.

Ahh I think that's the problem then. I'm using this in a small
department of ~50 people, split up into five or so groups. Each user
will belong to only one group, but they should be able to see everyone
in all the groups. Since I'm the only one in the "IT" group, that would
explain why my roster is empty.

> We're working on supporting alternative functionality, e.g. making a
> group of JIDs visible to everyone on the server. Unfortunately it's
> tricky and we haven't finished yet. You can track progress at
> http://prosody.im/bugs/167

Looks like that's what I'm after. Hopefully it will allow multiple
groups too...

> If you're looking for something more similar to jabberd2's roster
> population, you might be after mod_support_contact:
> http://code.google.com/p/prosody-modules/wiki/mod_support_contact
> (perhaps with support for multiple JIDs?).

Hmm, this could work, if I can have multiple JIDs in multiple groups.
Unfortunately I'm not using in-band registration though, as I have a
nightly script that runs 'prosodyctl register' to populate the accounts
automatically. So it looks like that may not work just at the moment.

> Hope this helps... and if I'm barking up completely the wrong tree
> about your problem, let me know :)

For the record I wasn't using jabberd2's shared rosters (I don't think
it was available when I first set it up) but rather I had a script that
populated the underlying MySQL tables to make it look like the users had
added each other to their rosters.

I wonder whether I could do the same thing here? Not being familiar
with Lua I'm not sure whether I could load the .dat file for each user
and modify it, or whether I could just overwrite the .dat file as if I
was writing out any old text file. I guess that would potentially lose
some user settings, but then I have a captive audience here so that may
not be too problematic.

What do you think?

Thanks again,
Adam.

Matthew Wild

unread,
Oct 5, 2011, 7:10:51 AM10/5/11
to prosod...@googlegroups.com

I started making a script to demonstrate managing rosters via
Prosody's API for you. It grew into a small module for managing
rosters via prosodyctl, so it might just suit you as-is. Either way,
feel free to use or hack up the code however you want:
http://prosody.im/files/mod_roster_command.lua (instructions at the
top of the file)

Regards,
Matthew

Adam Nielsen

unread,
Oct 6, 2011, 3:02:55 AM10/6/11
to prosod...@googlegroups.com
> I started making a script to demonstrate managing rosters via
> Prosody's API for you. It grew into a small module for managing
> rosters via prosodyctl, so it might just suit you as-is. Either way,
> feel free to use or hack up the code however you want:
> http://prosody.im/files/mod_roster_command.lua (instructions at the
> top of the file)

Wow nice. It works *almost* perfectly as is - everyone gets added to
everyone else's roster but they're not split up into groups.

I've had a look at the code but I'm not quite sure how to add people to
groups. I can only see in mod_roster where it sets a group and then
pushes it out to other resources but I'm not quite sure how to apply
that to the rostermanager subscription process in mod_roster_command.

Any pointers?

Many thanks,
Adam.

Adam Nielsen

unread,
Oct 6, 2011, 9:45:18 PM10/6/11
to prosod...@googlegroups.com
> Wow nice. It works *almost* perfectly as is - everyone gets added to
> everyone else's roster but they're not split up into groups.
>
> I've had a look at the code but I'm not quite sure how to add people to
> groups. I can only see in mod_roster where it sets a group and then
> pushes it out to other resources but I'm not quite sure how to apply
> that to the rostermanager subscription process in mod_roster_command.

Ok I think I figured this out. I've attached an updated
mod_roster_command.lua which adds a new command "rename". This both
sets the name to show in the roster (avoiding a list full of JIDs) and
adds people into the correct groups.

I'm not sure whether I've done it correctly or not, but it does work for
me. Hopefully (perhaps after fixing my mistakes) you'll include this
module in the official distribution too, it's very useful!

Thanks Matthew for the code that got me started as well :-)

Cheers,
Adam.

mod_roster_command.lua

Matthew Wild

unread,
Oct 10, 2011, 9:00:23 PM10/10/11
to prosod...@googlegroups.com

Excellent, thank you! I've uploaded this version to prosody-modules
for everyone to enjoy:
http://code.google.com/p/prosody-modules/wiki/mod_roster_command

Just let me know if you make any other changes, or would like access
to the prosody-modules repository to update it yourself.

Regards,
Matthew

Guilhem LETTRON

unread,
Oct 20, 2011, 5:31:49 AM10/20/11
to prosod...@googlegroups.com
I don't know if you know this trick :

in mod_groups, add an "+" before the name of a group make it public for all yours contacts (not only members of this group). This is somethings equal to mod "support")

[+GroupTestPublic]
jid1
jid2

[GroupTestPrivate]
jid3
jid4


-- Guilhem Lettron


2011/10/11 Matthew Wild <mwi...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Prosody IM Users" group.
To post to this group, send an email to prosod...@googlegroups.com.
To unsubscribe from this group, send email to prosody-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/prosody-users?hl=en-GB.


Michael Ventura

unread,
Nov 12, 2013, 9:53:04 AM11/12/13
to prosod...@googlegroups.com
Somebody ought to update the docs for this. I'd do it myself, but it doesn't seem to be a wiki :P

Matthew Wild

unread,
Nov 12, 2013, 10:31:16 AM11/12/13
to Prosody IM Users Group
On 12 November 2013 14:53, Michael Ventura <michael...@gmail.com> wrote:
> Somebody ought to update the docs for this. I'd do it myself, but it doesn't
> seem to be a wiki :P

It's intentionally not documented due to this bug: https://prosody.im/bugs/167

After the XMPP summit a couple of weeks ago Waqas and I discussed for
a bit some ideas to refactor the roster code to allow us to easily fix
this, implement dynamic groups, external rosters and other nice things
we've been waiting a long time for. It's early days, but I think we
have a plan now!

Regards,
Matthew

Tomasz Sanecki

unread,
Feb 4, 2014, 5:54:16 PM2/4/14
to prosod...@googlegroups.com, adam.n...@uq.edu.au
Hi Guys,

I have installed prosody recently in my company and had to add contact list to all users. At first, I thought that mod_groups would do the job but I discovered that I was wrong (in a painful way: after deleting all users' rosters from database and hoping to reload them from a file). Now I know that you need to be in group in order to have this group imported to your rosters.

I have modified this module to behave in a different way. Please note that this is my first attempt to code in lua ;)


mod_pubgroups.lua
Reply all
Reply to author
Forward
0 new messages