25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +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> 2003-11-23 Alexey Shchepin <alexey@sevcom.net>
* src/cyrsasl_digest.erl: Bugfix (thanks to Sergei Golovan) * 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) -> process_presence_probe(From, To, StateData) ->
LFrom = jlib:jid_tolower(From), LFrom = jlib:jid_tolower(From),
LBFrom = setelement(3, LFrom, ""),
case StateData#state.pres_last of case StateData#state.pres_last of
undefined -> undefined ->
ok; ok;
_ -> _ ->
Cond1 = (not StateData#state.pres_invis) Cond1 = (not StateData#state.pres_invis)
and ?SETS:is_element(LFrom, StateData#state.pres_f) andalso (?SETS:is_element(LFrom, StateData#state.pres_f)
and (not ?SETS:is_element(LFrom, StateData#state.pres_i)), 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 Cond2 = StateData#state.pres_invis
and ?SETS:is_element(LFrom, StateData#state.pres_f) andalso ?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_a),
if if
Cond1 -> Cond1 ->
Packet = StateData#state.pres_last, Packet = StateData#state.pres_last,
@ -949,6 +957,8 @@ presence_update(From, Packet, StateData) ->
NewState; NewState;
"error" -> "error" ->
StateData; StateData;
"probe" ->
StateData;
"subscribe" -> "subscribe" ->
StateData; StateData;
"subscribed" -> "subscribed" ->
@ -1022,6 +1032,9 @@ presence_track(From, To, Packet, StateData) ->
"error" -> "error" ->
ejabberd_router:route(From, To, Packet), ejabberd_router:route(From, To, Packet),
StateData; StateData;
"probe" ->
ejabberd_router:route(From, To, Packet),
StateData;
_ -> _ ->
%-ifdef(PRIVACY_SUPPORT). %-ifdef(PRIVACY_SUPPORT).
case catch mod_privacy:check_packet( case catch mod_privacy:check_packet(