comparison mcabber/mcabber/xmpp.c @ 2137:0bfc4bfc127c

Add support for storing passwords to a MUC (Nico Golde) (Imported from the Debian package.) This patch (by Nico Golde <nion@debian.org>) adds support for storing MUC passwords.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 06 Jul 2014 13:12:10 +0200
parents fc7a758ebbde
children f063e36425a2
comparison
equal deleted inserted replaced
2136:54548cf8f646 2137:0bfc4bfc127c
2282 // Walk through the storage bookmark tags 2282 // Walk through the storage bookmark tags
2283 for (x = bookmarks->children ; x; x = x->next) { 2283 for (x = bookmarks->children ; x; x = x->next) {
2284 // If the node is a conference item, let's add the note to our list. 2284 // If the node is a conference item, let's add the note to our list.
2285 if (x->name && !strcmp(x->name, "conference")) { 2285 if (x->name && !strcmp(x->name, "conference")) {
2286 struct bookmark *bm_elt; 2286 struct bookmark *bm_elt;
2287 const char *autojoin, *name, *nick; 2287 const char *autojoin, *name, *nick, *passwd;
2288 const char *fjid = lm_message_node_get_attribute(x, "jid"); 2288 const char *fjid = lm_message_node_get_attribute(x, "jid");
2289 if (!fjid) 2289 if (!fjid)
2290 continue; 2290 continue;
2291 bm_elt = g_new0(struct bookmark, 1); 2291 bm_elt = g_new0(struct bookmark, 1);
2292 bm_elt->roomjid = g_strdup(fjid); 2292 bm_elt->roomjid = g_strdup(fjid);
2293 autojoin = lm_message_node_get_attribute(x, "autojoin"); 2293 autojoin = lm_message_node_get_attribute(x, "autojoin");
2294 nick = lm_message_node_get_child_value(x, "nick"); 2294 nick = lm_message_node_get_child_value(x, "nick");
2295 name = lm_message_node_get_attribute(x, "name"); 2295 name = lm_message_node_get_attribute(x, "name");
2296 passwd = lm_message_node_get_child_value(x, "password");
2296 if (autojoin && (!strcmp(autojoin, "1") || !strcmp(autojoin, "true"))) 2297 if (autojoin && (!strcmp(autojoin, "1") || !strcmp(autojoin, "true")))
2297 bm_elt->autojoin = 1; 2298 bm_elt->autojoin = 1;
2298 if (nick) 2299 if (nick)
2299 bm_elt->nick = g_strdup(nick); 2300 bm_elt->nick = g_strdup(nick);
2300 if (name) 2301 if (name)
2301 bm_elt->name = g_strdup(name); 2302 bm_elt->name = g_strdup(name);
2303 if (passwd)
2304 bm_elt->password = g_strdup(passwd);
2302 sl_bookmarks = g_slist_append(sl_bookmarks, bm_elt); 2305 sl_bookmarks = g_slist_append(sl_bookmarks, bm_elt);
2303 } 2306 }
2304 } 2307 }
2305 return sl_bookmarks; 2308 return sl_bookmarks;
2306 } 2309 }