diff options
author | Maxim Ignatenko <gelraen.ua@gmail.com> | 2011-07-24 15:01:04 +0300 |
---|---|---|
committer | Maxim Ignatenko <gelraen.ua@gmail.com> | 2011-09-26 11:16:27 +0300 |
commit | c77358bdc1eebecd8fa51c1d850444e1c55d77c1 (patch) | |
tree | 5c81279496c2f5febe4ab6c9872c8551a1585032 /src | |
parent | Fix exception handling in is_voice_request/1 (diff) |
Use exception handling in is_invitation/1
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_muc/mod_muc_room.erl | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index 5f9edfd2f..16b8de841 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -3715,20 +3715,19 @@ send_packet_to(Packet, To, StateData) -> % Invitation support is_invitation(Els) -> - case xml:remove_cdata(Els) of - [{xmlelement, "x", _Attrs1, Els1} = XEl] -> - case xml:get_tag_attr_s("xmlns", XEl) of - ?NS_MUC_USER -> - case xml:remove_cdata(Els1) of - [{xmlelement, "invite", _, _}] -> - true; - _ -> - false - end; - _ -> - false - end; - _ -> + try + case xml:remove_cdata(Els) of + [{xmlelement, "x", _Attrs1, Els1} = XEl] -> + case xml:get_tag_attr_s("xmlns", XEl) of + ?NS_MUC_USER -> + case xml:remove_cdata(Els1) of + [{xmlelement, "invite", _, _}] -> + true + end + end + end + catch + error: _ -> false end. |