summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-10-13 20:48:21 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2017-10-13 20:48:21 +0300
commit1bb2bae62b446f279182d4474076b97e887b1f49 (patch)
tree8085857f2766b456c7baa01ac6151bc5cc6207e9
parentSend presence-unavailable when expulsing a participant (diff)
Reflect changes in the xmpp lib
-rw-r--r--rebar.config2
-rw-r--r--src/mod_muc_room.erl2
-rw-r--r--src/mod_s2s_dialback.erl8
-rw-r--r--src/xmpp_stream_in.erl10
-rw-r--r--src/xmpp_stream_out.erl10
5 files changed, 16 insertions, 16 deletions
diff --git a/rebar.config b/rebar.config
index 5806e6ae..f24a1677 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 27ecceec..6e83a374 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 403ac9cc..b4c2ed9d 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 d9be3d4f..329ebad6 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 982be4de..460f380d 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.