diff options
| author | Mickaël Rémond <mickael.remond@process-one.net> | 2007-02-19 09:45:58 +0000 |
|---|---|---|
| committer | Mickaël Rémond <mickael.remond@process-one.net> | 2007-02-19 09:45:58 +0000 |
| commit | 909cfd7b21fa003f7dd5612c4e55a367079cb3b0 (patch) | |
| tree | 099d91979ec3d483c82015515359e53e3362a57c /src | |
| parent | * src/ejabberd_s2s.erl: Confirm to RFC3920 section 10.3 (thanks to (diff) | |
* src/mod_muc/mod_muc_room.erl: API improvement: Implementation of an
event to destroy MUC room from an external application (Thanks to
Massimiliano Mirra) (EJAB-184).
SVN Revision: 727
Diffstat (limited to 'src')
| -rw-r--r-- | src/mod_muc/mod_muc_room.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index e2f7d190d..5a821f8f1 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -606,6 +606,21 @@ handle_event({service_message, Msg}, _StateName, StateData) -> StateData), {next_state, normal_state, NSD}; +handle_event({destroy, Reason}, _StateName, StateData) -> + {result, [], stop} = + destroy_room( + {xmlelement, "destroy", + [{"xmlns", ?NS_MUC_OWNER}], + case Reason of + none -> []; + _Else -> + [{xmlelement, "reason", + [], [{xmlcdata, Reason}]}] + end}, StateData), + {stop, stopped_by_event, StateData}; +handle_event(destroy, StateName, StateData) -> + handle_event({destroy, none}, StateName, StateData); + handle_event(_Event, StateName, StateData) -> {next_state, StateName, StateData}. |
