Mercurial > hg
comparison mcabber/src/commands.c @ 449:e08b0c2d0e54
Add "/room unlock"
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 25 Sep 2005 23:45:34 +0200 |
parents | 39a28cb59af3 |
children | dfd9c62b3a39 |
comparison
equal
deleted
inserted
replaced
448:39a28cb59af3 | 449:e08b0c2d0e54 |
---|---|
151 // Room category | 151 // Room category |
152 compl_add_category_word(COMPL_ROOM, "join"); | 152 compl_add_category_word(COMPL_ROOM, "join"); |
153 compl_add_category_word(COMPL_ROOM, "leave"); | 153 compl_add_category_word(COMPL_ROOM, "leave"); |
154 compl_add_category_word(COMPL_ROOM, "names"); | 154 compl_add_category_word(COMPL_ROOM, "names"); |
155 compl_add_category_word(COMPL_ROOM, "remove"); | 155 compl_add_category_word(COMPL_ROOM, "remove"); |
156 compl_add_category_word(COMPL_ROOM, "unlock"); | |
156 } | 157 } |
157 | 158 |
158 // expandalias(line) | 159 // expandalias(line) |
159 // If there is one, expand the alias in line and returns a new allocated line | 160 // If there is one, expand the alias in line and returns a new allocated line |
160 // If no alias is found, returns line | 161 // If no alias is found, returns line |
973 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom"); | 974 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom"); |
974 return; | 975 return; |
975 } | 976 } |
976 do_info(NULL); | 977 do_info(NULL); |
977 } else if (!strcasecmp(arg, "remove")) { | 978 } else if (!strcasecmp(arg, "remove")) { |
978 gpointer bud; | |
979 bud = BUDDATA(current_buddy); | |
980 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) { | 979 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) { |
981 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom"); | 980 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom"); |
982 return; | 981 return; |
983 } | 982 } |
984 // Quick check: if there are resources, we haven't left | 983 // Quick check: if there are resources, we haven't left |
988 } | 987 } |
989 // Delete the room | 988 // Delete the room |
990 roster_del_user(buddy_getjid(bud)); | 989 roster_del_user(buddy_getjid(bud)); |
991 buddylist_build(); | 990 buddylist_build(); |
992 update_roster = TRUE; | 991 update_roster = TRUE; |
992 } else if (!strcasecmp(arg, "unlock")) { | |
993 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) { | |
994 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom"); | |
995 return; | |
996 } | |
997 jb_room_unlock(buddy_getjid(bud)); | |
993 } else { | 998 } else { |
994 scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); | 999 scr_LogPrint(LPRINT_NORMAL, "Unrecognized parameter!"); |
995 } | 1000 } |
996 } | 1001 } |
997 | 1002 |