25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

* src/ejabberd_c2s.erl: Fixed processing of presence probe from

client

SVN Revision: 177
This commit is contained in:
Alexey Shchepin 2003-11-26 19:18:42 +00:00
parent 0822a55f05
commit 9fc8e18eb3
2 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2003-11-26 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_c2s.erl: Fixed processing of presence probe from
client
2003-11-23 Alexey Shchepin <alexey@sevcom.net>
* src/cyrsasl_digest.erl: Bugfix (thanks to Sergei Golovan)

View File

@ -879,16 +879,24 @@ get_auth_tags([], U, P, D, R) ->
process_presence_probe(From, To, StateData) ->
LFrom = jlib:jid_tolower(From),
LBFrom = setelement(3, LFrom, ""),
case StateData#state.pres_last of
undefined ->
ok;
_ ->
Cond1 = (not StateData#state.pres_invis)
and ?SETS:is_element(LFrom, StateData#state.pres_f)
and (not ?SETS:is_element(LFrom, StateData#state.pres_i)),
andalso (?SETS:is_element(LFrom, StateData#state.pres_f)
orelse
((LFrom /= LBFrom) andalso
?SETS:is_element(LBFrom, StateData#state.pres_f)))
andalso (not
(?SETS:is_element(LFrom, StateData#state.pres_i)
orelse
((LFrom /= LBFrom) andalso
?SETS:is_element(LBFrom, StateData#state.pres_i)))),
Cond2 = StateData#state.pres_invis
and ?SETS:is_element(LFrom, StateData#state.pres_f)
and ?SETS:is_element(LFrom, StateData#state.pres_a),
andalso ?SETS:is_element(LFrom, StateData#state.pres_f)
andalso ?SETS:is_element(LFrom, StateData#state.pres_a),
if
Cond1 ->
Packet = StateData#state.pres_last,
@ -949,6 +957,8 @@ presence_update(From, Packet, StateData) ->
NewState;
"error" ->
StateData;
"probe" ->
StateData;
"subscribe" ->
StateData;
"subscribed" ->
@ -1022,6 +1032,9 @@ presence_track(From, To, Packet, StateData) ->
"error" ->
ejabberd_router:route(From, To, Packet),
StateData;
"probe" ->
ejabberd_router:route(From, To, Packet),
StateData;
_ ->
%-ifdef(PRIVACY_SUPPORT).
case catch mod_privacy:check_packet(