# HG changeset patch # User Mikael Berthe # Date 1134685796 -3600 # Node ID a6b8b373e4de50f9a2b896b7497f4ab2f3789e6f # Parent 789ec6aed764af07559faae91c5b9e2cc8310dc0 Try to guess if a roster item is an agent For now we look if the jid contains a '@'... diff -r 789ec6aed764 -r a6b8b373e4de mcabber/src/jab_iq.c --- a/mcabber/src/jab_iq.c Thu Dec 15 23:08:22 2005 +0100 +++ b/mcabber/src/jab_iq.c Thu Dec 15 23:29:56 2005 +0100 @@ -47,6 +47,7 @@ char *cleanalias; enum subscr esub; int need_refresh = FALSE; + guint roster_type; for (y = xmlnode_get_tag(x, "item"); y; y = xmlnode_get_nextsibling(y)) { gchar *name_noutf8 = NULL; @@ -100,8 +101,13 @@ group); } - roster_add_user(cleanalias, buddyname, group_noutf8, ROSTER_TYPE_USER, - esub); + // Tricky... :-\ My guess is that if there is no '@', this is an agent + if (strchr(cleanalias, '@')) + roster_type = ROSTER_TYPE_USER; + else + roster_type = ROSTER_TYPE_AGENT; + + roster_add_user(cleanalias, buddyname, group_noutf8, roster_type, esub); if (name_noutf8) g_free(name_noutf8); if (group_noutf8) g_free(group_noutf8);