aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Ignatenko <gelraen.ua@gmail.com>2011-07-24 15:01:04 +0300
committerMaxim Ignatenko <gelraen.ua@gmail.com>2011-09-26 11:16:27 +0300
commitc77358bdc1eebecd8fa51c1d850444e1c55d77c1 (patch)
tree5c81279496c2f5febe4ab6c9872c8551a1585032 /src
parentFix 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.erl27
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.