diff options
author | Alexey Shchepin <alexey@process-one.net> | 2002-11-27 20:46:29 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2002-11-27 20:46:29 +0000 |
commit | b2229bffcc8e5f7c4a919d2d2410d63e7718467e (patch) | |
tree | 80052a996eed95652e8660cc4ca398817d2723a8 /src/xml.erl | |
parent | *** empty log message *** (diff) |
*** empty log message ***
SVN Revision: 8
Diffstat (limited to 'src/xml.erl')
-rw-r--r-- | src/xml.erl | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/xml.erl b/src/xml.erl index 5ae3cb59..9ae4d509 100644 --- a/src/xml.erl +++ b/src/xml.erl @@ -11,7 +11,7 @@ -vsn('$Revision$ '). -export([element_to_string/1, crypt/1, remove_cdata/1, get_cdata/1, - get_attr/2, get_attr_s/2, make_error_iq_reply/3]). + get_attr/2, get_attr_s/2]). element_to_string(El) -> case El of @@ -91,30 +91,3 @@ get_attr_s(AttrName, Attrs) -> end. -make_error_iq_reply({xmlelement, Name, Attrs, SubTags}, Code, Desc) - when Name == "iq" -> - NewAttrs = make_error_iq_reply_attrs(Attrs), - {xmlelement, Name, NewAttrs, SubTags ++ [{xmlelement, "error", - [{"code", Code}], - [{xmlcdata, Desc}]}]}. - -make_error_iq_reply_attrs(Attrs) -> - To = get_attr("to", Attrs), - From = get_attr("from", Attrs), - Attrs1 = lists:keydelete("to", 1, Attrs), - Attrs2 = lists:keydelete("from", 1, Attrs1), - Attrs3 = case To of - {value, ToVal} -> - [{"from", ToVal} | Attrs2]; - _ -> - Attrs2 - end, - Attrs4 = case From of - {value, FromVal} -> - [{"to", FromVal} | Attrs3]; - _ -> - Attrs3 - end, - Attrs5 = lists:keydelete("type", 1, Attrs4), - Attrs6 = [{"type", "error"} | Attrs5], - Attrs6. |