comparison mcabber/src/jab_iq.c @ 1379:74b7621537d7

MUC: Store room settings (print_status, auto_whois) in private storage
author Mikael Berthe <mikael@lilotux.net>
date Thu, 29 Nov 2007 20:54:38 +0100
parents c7e709719c43
children 216b4da93e08
comparison
equal deleted inserted replaced
1378:61fc9eddf763 1379:74b7621537d7
737 } 737 }
738 738
739 static void storage_bookmarks_parse_conference(xmlnode xmldata) 739 static void storage_bookmarks_parse_conference(xmlnode xmldata)
740 { 740 {
741 const char *fjid, *name, *autojoin; 741 const char *fjid, *name, *autojoin;
742 const char *pstatus, *awhois;
742 char *bjid; 743 char *bjid;
743 GSList *room_elt; 744 GSList *room_elt;
744 745
745 fjid = xmlnode_get_attrib(xmldata, "jid"); 746 fjid = xmlnode_get_attrib(xmldata, "jid");
746 if (!fjid) 747 if (!fjid)
747 return; 748 return;
748 name = xmlnode_get_attrib(xmldata, "name"); 749 name = xmlnode_get_attrib(xmldata, "name");
749 autojoin = xmlnode_get_attrib(xmldata, "autojoin"); 750 autojoin = xmlnode_get_attrib(xmldata, "autojoin");
751 awhois = xmlnode_get_attrib(xmldata, "autowhois");
752 pstatus = xmlnode_get_tag_data(xmldata, "print_status");
750 753
751 bjid = jidtodisp(fjid); // Bare jid 754 bjid = jidtodisp(fjid); // Bare jid
752 755
753 // Make sure this is a room (it can be a conversion user->room) 756 // Make sure this is a room (it can be a conversion user->room)
754 room_elt = roster_find(bjid, jidsearch, 0); 757 room_elt = roster_find(bjid, jidsearch, 0);
762 // I don't think so, it would be confusing because this item is already 765 // I don't think so, it would be confusing because this item is already
763 // in the roster. 766 // in the roster.
764 if (name) 767 if (name)
765 buddy_setname(room_elt->data, name); 768 buddy_setname(room_elt->data, name);
766 */ 769 */
770 }
771
772 // Set the print_status and auto_whois values
773 if (pstatus) {
774 enum room_printstatus i;
775 for (i = status_none; i <= status_all; i++)
776 if (!strcasecmp(pstatus, strprintstatus[i]))
777 break;
778 if (i <= status_all)
779 buddy_setprintstatus(room_elt->data, i);
780 }
781 if (awhois) {
782 enum room_autowhois i = autowhois_default;
783 if (!strcmp(awhois, "1"))
784 i = autowhois_on;
785 else if (!strcmp(awhois, "0"))
786 i = autowhois_off;
787 if (i != autowhois_default)
788 buddy_setautowhois(room_elt->data, i);
767 } 789 }
768 790
769 // Is autojoin set? 791 // Is autojoin set?
770 // If it is, we'll look up for more information (nick? password?) and 792 // If it is, we'll look up for more information (nick? password?) and
771 // try to join the room. 793 // try to join the room.