Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is_voice_request(Els) ->
- case xml:remove_cdata(Els) of
- [{xmlelement, "x", _, Els1} = XEl] ->
- case xml:get_attr_s("xmlns", XEl) of
- ?NS_XDATA ->
- case catch lists:foldl(check_voice_requests_field, true, Els1) of
- true ->
- true;
- _ ->
- false
- end;
- _ ->
- false
- end;
- _ ->
- false
- end.
- check_voice_request_fields({xmlelement, "field", _, Els} = Elem, Acc) ->
- case Acc of
- true ->
- case xml:get_attr_s("var", Elem) of
- "FORM_TYPE" ->
- [{xmlelement, "value", _, Value}] = Els,
- case xml:get_cdata(Value) of
- "http://jabber.org/protocol/muc#request" ->
- true;
- _ ->
- false
- end;
- "muc#role" ->
- [{xmlelement, "value", _, Value}] = Els,
- case xml:get_cdata(Value) of
- "participant" ->
- true;
- _ ->
- false
- end
- end;
- false ->
- false
- end.
Advertisement
Add Comment
Please, Sign In to add comment