From 1bb2bae62b446f279182d4474076b97e887b1f49 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 13 Oct 2017 20:48:21 +0300 Subject: [PATCH] Reflect changes in the xmpp lib --- rebar.config | 2 +- src/mod_muc_room.erl | 2 +- src/mod_s2s_dialback.erl | 8 ++++---- src/xmpp_stream_in.erl | 10 +++++----- src/xmpp_stream_out.erl | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rebar.config b/rebar.config index 5806e6ae3..f24a16777 100644 --- a/rebar.config +++ b/rebar.config @@ -25,7 +25,7 @@ {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.16"}}}, {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.10"}}}, {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.24"}}}, - {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.1.15"}}}, + {xmpp, ".*", {git, "https://github.com/processone/xmpp", "d551ba9"}}, {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.11"}}}, {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}, {p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.2"}}}, diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 27ecceecf..6e83a374f 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -1241,7 +1241,7 @@ get_error_condition(undefined) -> -spec get_error_text(stanza_error()) -> binary(). get_error_text(#stanza_error{text = Txt}) -> - xmpp:get_text([Txt]). + xmpp:get_text(Txt). -spec make_reason(stanza(), jid(), state(), binary()) -> binary(). make_reason(Packet, From, StateData, Reason1) -> diff --git a/src/mod_s2s_dialback.erl b/src/mod_s2s_dialback.erl index 403ac9cce..b4c2ed9df 100644 --- a/src/mod_s2s_dialback.erl +++ b/src/mod_s2s_dialback.erl @@ -353,9 +353,9 @@ format_stanza_error(#stanza_error{reason = Reason, text = Txt}) -> #redirect{} -> <<"redirect">>; _ -> erlang:atom_to_binary(Reason, latin1) end, - case Txt of - undefined -> Slogan; - #text{data = <<"">>} -> Slogan; - #text{data = Data} -> + case xmpp:get_text(Txt) of + <<"">> -> + Slogan; + Data -> <> end. diff --git a/src/xmpp_stream_in.erl b/src/xmpp_stream_in.erl index d9be3d4f7..329ebad61 100644 --- a/src/xmpp_stream_in.erl +++ b/src/xmpp_stream_in.erl @@ -1117,17 +1117,17 @@ format_inet_error(Reason) -> Txt -> Txt end. --spec format_stream_error(atom() | 'see-other-host'(), undefined | text()) -> string(). +-spec format_stream_error(atom() | 'see-other-host'(), [text()]) -> string(). format_stream_error(Reason, Txt) -> Slogan = case Reason of undefined -> "no reason"; #'see-other-host'{} -> "see-other-host"; _ -> atom_to_list(Reason) end, - case Txt of - undefined -> Slogan; - #text{data = <<"">>} -> Slogan; - #text{data = Data} -> + case xmpp:get_text(Txt) of + <<"">> -> + Slogan; + Data -> binary_to_list(Data) ++ " (" ++ Slogan ++ ")" end. diff --git a/src/xmpp_stream_out.erl b/src/xmpp_stream_out.erl index 982be4dee..460f380d2 100644 --- a/src/xmpp_stream_out.erl +++ b/src/xmpp_stream_out.erl @@ -796,17 +796,17 @@ format_inet_error(Reason) -> Txt -> Txt end. --spec format_stream_error(atom() | 'see-other-host'(), undefined | text()) -> string(). +-spec format_stream_error(atom() | 'see-other-host'(), [text()]) -> string(). format_stream_error(Reason, Txt) -> Slogan = case Reason of undefined -> "no reason"; #'see-other-host'{} -> "see-other-host"; _ -> atom_to_list(Reason) end, - case Txt of - undefined -> Slogan; - #text{data = <<"">>} -> Slogan; - #text{data = Data} -> + case xmpp:get_text(Txt) of + <<"">> -> + Slogan; + Data -> binary_to_list(Data) ++ " (" ++ Slogan ++ ")" end.