aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-roomlist.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>2008-12-18 06:41:30 +0800
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-04-18 04:24:16 +0800
commit1df3cf4311df50cbe3c3909010828b068da53f1d (patch)
tree2e7cb8741ee35e4428b639473d8e18783975e9cf /libempathy/empathy-tp-roomlist.c
parente57f5cfac0d04a01dd94bf4404cd17d5f4706c8a (diff)
downloadgsoc2013-empathy-1df3cf4311df50cbe3c3909010828b068da53f1d.tar
gsoc2013-empathy-1df3cf4311df50cbe3c3909010828b068da53f1d.tar.gz
gsoc2013-empathy-1df3cf4311df50cbe3c3909010828b068da53f1d.tar.bz2
gsoc2013-empathy-1df3cf4311df50cbe3c3909010828b068da53f1d.tar.lz
gsoc2013-empathy-1df3cf4311df50cbe3c3909010828b068da53f1d.tar.xz
gsoc2013-empathy-1df3cf4311df50cbe3c3909010828b068da53f1d.tar.zst
gsoc2013-empathy-1df3cf4311df50cbe3c3909010828b068da53f1d.zip
Add more information to EmpathyChatroom
- Invite Only - Require password - Subject - Member count
Diffstat (limited to 'libempathy/empathy-tp-roomlist.c')
-rw-r--r--libempathy/empathy-tp-roomlist.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libempathy/empathy-tp-roomlist.c b/libempathy/empathy-tp-roomlist.c
index a1583c083..fc2526fd0 100644
--- a/libempathy/empathy-tp-roomlist.c
+++ b/libempathy/empathy-tp-roomlist.c
@@ -122,6 +122,10 @@ tp_roomlist_got_rooms_cb (TpChannel *channel,
for (i = 0; i < rooms->len; i++) {
const GValue *room_name_value;
const GValue *handle_name_value;
+ const GValue *room_members_value;
+ const GValue *room_subject_value;
+ const GValue *room_invite_value;
+ const GValue *room_password_value;
GValueArray *room_struct;
guint handle;
const gchar *channel_type;
@@ -134,6 +138,10 @@ tp_roomlist_got_rooms_cb (TpChannel *channel,
info = g_value_get_boxed (g_value_array_get_nth (room_struct, 2));
room_name_value = g_hash_table_lookup (info, "name");
handle_name_value = g_hash_table_lookup (info, "handle-name");
+ room_subject_value = g_hash_table_lookup (info, "subject");
+ room_members_value = g_hash_table_lookup (info, "members");
+ room_invite_value = g_hash_table_lookup (info, "invite-only");
+ room_password_value = g_hash_table_lookup (info, "password");
if (tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TEXT)) {
continue;
@@ -146,6 +154,26 @@ tp_roomlist_got_rooms_cb (TpChannel *channel,
g_value_get_string (room_name_value));
}
+ if (room_members_value != NULL) {
+ empathy_chatroom_set_members_count (chatroom,
+ g_value_get_uint (room_members_value));
+ }
+
+ if (room_subject_value != NULL) {
+ empathy_chatroom_set_subject (chatroom,
+ g_value_get_string (room_subject_value));
+ }
+
+ if (room_invite_value != NULL) {
+ empathy_chatroom_set_invite_only (chatroom,
+ g_value_get_boolean (room_invite_value));
+ }
+
+ if (room_password_value != NULL) {
+ empathy_chatroom_set_need_password (chatroom,
+ g_value_get_boolean (room_password_value));
+ }
+
if (handle_name_value != NULL) {
empathy_chatroom_set_room (chatroom,
g_value_get_string (handle_name_value));