| CODENOTIFIER | HelpYou are not signed inSign in |
Project: ejabberd-modules
Revision: 704
Author: badlop
Date: 01 Aug 2008 15:24:13
Changes:Revert back previous commands too.
Files:| ... | ...@@ -95,8 +95,6 @@ | |
| 95 | 95 | |
| 96 | 96 | commands_global() -> |
| 97 | 97 | [ |
| 98 | {"muc-participants-number room service", "get number of participants in a room"}, | |
| 99 | {"muc-participants-list room service", "get list of participants in a room"}, | |
| 100 | 98 | {"muc-unregister-nick nick", "unregister the nick in the muc service"}, |
| 101 | 99 | {"muc-create-file file", "create the rooms indicated in file"}, |
| 102 | 100 | {"muc-destroy-file file", "destroy the rooms whose JID is indicated in file"}, |
| ... | ...@@ -112,26 +110,6 @@ | |
| 112 | 110 | {"muc-online-rooms", "list existing rooms"} |
| 113 | 111 | ]. |
| 114 | 112 | |
| 115 | ctl_process(_Val, ["muc-participants-number", Room, Service]) -> | |
| 116 | case get_participants_number(Room, Service) of | |
| 117 | Num when is_integer(Num) -> | |
| 118 | io:format("~p~n", [Num]), | |
| 119 | ?STATUS_SUCCESS; | |
| 120 | {error, Error} -> | |
| 121 | io:format("Error getting participants of ~p: ~p~n", [Room, Error]), | |
| 122 | ?STATUS_ERROR | |
| 123 | end; | |
| 124 | ||
| 125 | ctl_process(_Val, ["muc-participants-list", Room, Service]) -> | |
| 126 | case get_participants_list(Room, Service) of | |
| 127 | PartList when is_list(PartList) -> | |
| 128 | [io:format("~s@~s/~s~n", [U, S, R]) || {U, S, R} <- PartList], | |
| 129 | ?STATUS_SUCCESS; | |
| 130 | {error, Error} -> | |
| 131 | io:format("Error getting participants of ~p: ~p~n", [Room, Error]), | |
| 132 | ?STATUS_ERROR | |
| 133 | end; | |
| 134 | ||
| 135 | 113 | ctl_process(_Val, ["muc-unregister-nick", Nick]) -> |
| 136 | 114 | case muc_unregister_nick(Nick) of |
| 137 | 115 | unregistered -> |
| ... | ...@@ -360,20 +338,6 @@ | |
| 360 | 338 | |
| 361 | 339 | |
| 362 | 340 | %%---------------------------- |
| 363 | %% Get Numer of Participants | |
| 364 | %%---------------------------- | |
| 365 | ||
| 366 | get_participants_list(Room, Service) -> | |
| 367 | Pid = get_room_pid(Room, Service), | |
| 368 | S = get_room_state(Pid), | |
| 369 | dict:fetch_keys(S#state.users). | |
| 370 | ||
| 371 | get_participants_number(Room, Service) -> | |
| 372 | List = get_participants_list(Room, Service), | |
| 373 | length(List). | |
| 374 | ||
| 375 | ||
| 376 | %%---------------------------- | |
| 377 | 341 | %% Create/Delete Room |
| 378 | 342 | %%---------------------------- |
| 379 | 343 |
| ... | ...@@ -1,8 +1,3 @@ | |
| 1 | 2008-08-01 Badlop <badlop@process-one.net> | |
| 2 | ||
| 3 | * src/mod_muc_admin.erl: New commands muc-participants-number and | |
| 4 | muc-participants-list | |
| 5 | ||
| 6 | 1 | 2008-05-16 Badlop <badlop@process-one.net> |
| 7 | 2 | |
| 8 | 3 | * src/mod_muc_admin.erl: New exported function |