diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-10-13 20:48:21 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-10-13 20:48:21 +0300 |
commit | 1bb2bae62b446f279182d4474076b97e887b1f49 (patch) | |
tree | 8085857f2766b456c7baa01ac6151bc5cc6207e9 /src | |
parent | Send presence-unavailable when expulsing a participant (diff) |
Reflect changes in the xmpp lib
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_muc_room.erl | 2 | ||||
-rw-r--r-- | src/mod_s2s_dialback.erl | 8 | ||||
-rw-r--r-- | src/xmpp_stream_in.erl | 10 | ||||
-rw-r--r-- | src/xmpp_stream_out.erl | 10 |
4 files changed, 15 insertions, 15 deletions
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 -> <<Data/binary, " (", Slogan/binary, ")">> 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. |