mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
* src/mod_roster.erl: Fixed bug with handling of roster set
stanzas that contains CDATA * src/mod_irc/mod_irc_connection.erl (handle_info/3): Fixed parsing of string that have "\n" line separators (not "\r\n") SVN Revision: 79
This commit is contained in:
parent
b704efd553
commit
8664881c8f
3 changed files with 17 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2003-02-20 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/mod_roster.erl: Fixed bug with handling of roster set
|
||||||
|
stanzas that contains CDATA
|
||||||
|
|
||||||
|
* src/mod_irc/mod_irc_connection.erl (handle_info/3): Fixed
|
||||||
|
parsing of string that have "\n" line separators (not "\r\n")
|
||||||
|
|
||||||
2003-02-18 Alexey Shchepin <alexey@sevcom.net>
|
2003-02-18 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
* src/mod_irc/: Added support for private chats, nicks changes and
|
* src/mod_irc/: Added support for private chats, nicks changes and
|
||||||
|
|
|
@ -365,7 +365,7 @@ handle_info({send_element, El}, StateName, StateData) ->
|
||||||
end;
|
end;
|
||||||
handle_info({tcp, Socket, Data}, StateName, StateData) ->
|
handle_info({tcp, Socket, Data}, StateName, StateData) ->
|
||||||
Buf = StateData#state.inbuf ++ binary_to_list(Data),
|
Buf = StateData#state.inbuf ++ binary_to_list(Data),
|
||||||
{ok, Strings} = regexp:split(Buf, "\r\n"),
|
{ok, Strings} = regexp:split([C || C <- Buf, C /= $\r], "\n"),
|
||||||
io:format("strings=~p~n", [Strings]),
|
io:format("strings=~p~n", [Strings]),
|
||||||
NewBuf = process_lines(Strings),
|
NewBuf = process_lines(Strings),
|
||||||
{next_state, StateName, StateData#state{inbuf = NewBuf}};
|
{next_state, StateName, StateData#state{inbuf = NewBuf}};
|
||||||
|
|
|
@ -125,9 +125,7 @@ process_iq_set(From, To, {iq, ID, Type, XMLNS, SubEl}) ->
|
||||||
lists:foreach(fun(El) -> process_item_set(User, From, To, El) end, Els),
|
lists:foreach(fun(El) -> process_item_set(User, From, To, El) end, Els),
|
||||||
{iq, ID, result, XMLNS, []}.
|
{iq, ID, result, XMLNS, []}.
|
||||||
|
|
||||||
process_item_set(User, From, To, XItem) ->
|
process_item_set(User, From, To, {xmlelement, Name, Attrs, Els} = XItem) ->
|
||||||
{xmlelement, Name, Attrs, Els} = XItem,
|
|
||||||
% TODO: load existing item
|
|
||||||
JID = jlib:string_to_jid(xml:get_attr_s("jid", Attrs)),
|
JID = jlib:string_to_jid(xml:get_attr_s("jid", Attrs)),
|
||||||
LUser = jlib:tolower(User),
|
LUser = jlib:tolower(User),
|
||||||
case JID of
|
case JID of
|
||||||
|
@ -199,7 +197,9 @@ process_item_set(User, From, To, XItem) ->
|
||||||
?DEBUG("ROSTER: roster item set error: ~p~n", [E]),
|
?DEBUG("ROSTER: roster item set error: ~p~n", [E]),
|
||||||
ok
|
ok
|
||||||
end
|
end
|
||||||
end.
|
end;
|
||||||
|
process_item_set(User, From, To, _) ->
|
||||||
|
ok.
|
||||||
|
|
||||||
process_item_attrs(Item, [{Attr, Val} | Attrs]) ->
|
process_item_attrs(Item, [{Attr, Val} | Attrs]) ->
|
||||||
case Attr of
|
case Attr of
|
||||||
|
@ -231,7 +231,6 @@ process_item_attrs(Item, []) ->
|
||||||
Item.
|
Item.
|
||||||
|
|
||||||
|
|
||||||
% {user, jid, name, subscription, groups, xattrs, xs}
|
|
||||||
process_item_els(Item, [{xmlelement, Name, Attrs, SEls} | Els]) ->
|
process_item_els(Item, [{xmlelement, Name, Attrs, SEls} | Els]) ->
|
||||||
case Name of
|
case Name of
|
||||||
"group" ->
|
"group" ->
|
||||||
|
@ -480,8 +479,7 @@ set_items(User, SubEl) ->
|
||||||
end,
|
end,
|
||||||
mnesia:transaction(F).
|
mnesia:transaction(F).
|
||||||
|
|
||||||
process_item_set_t(User, XItem) ->
|
process_item_set_t(User, {xmlelement, Name, Attrs, Els} = XItem) ->
|
||||||
{xmlelement, Name, Attrs, Els} = XItem,
|
|
||||||
JID = jlib:string_to_jid(xml:get_attr_s("jid", Attrs)),
|
JID = jlib:string_to_jid(xml:get_attr_s("jid", Attrs)),
|
||||||
LUser = jlib:tolower(User),
|
LUser = jlib:tolower(User),
|
||||||
case JID of
|
case JID of
|
||||||
|
@ -501,8 +499,9 @@ process_item_set_t(User, XItem) ->
|
||||||
_ ->
|
_ ->
|
||||||
mnesia:write(Item2)
|
mnesia:write(Item2)
|
||||||
end
|
end
|
||||||
end.
|
end;
|
||||||
|
process_item_set_t(User, _) ->
|
||||||
|
ok.
|
||||||
|
|
||||||
process_item_attrs_ws(Item, [{Attr, Val} | Attrs]) ->
|
process_item_attrs_ws(Item, [{Attr, Val} | Attrs]) ->
|
||||||
case Attr of
|
case Attr of
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue