Skip to content

Commit

Permalink
* src/ejabberd_c2s.erl: Fixed processing of presence probe from
Browse files Browse the repository at this point in the history
client

SVN Revision: 177
  • Loading branch information
alexeyshch committed Nov 26, 2003
1 parent 0822a55 commit 9fc8e18
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -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)
Expand Down
21 changes: 17 additions & 4 deletions src/ejabberd_c2s.erl
Expand Up @@ -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,
Expand Down Expand Up @@ -949,6 +957,8 @@ presence_update(From, Packet, StateData) ->
NewState;
"error" ->
StateData;
"probe" ->
StateData;
"subscribe" ->
StateData;
"subscribed" ->
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 9fc8e18

Please sign in to comment.