diff options
author | Alexey Shchepin <alexey@process-one.net> | 2003-12-21 18:16:08 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2003-12-21 18:16:08 +0000 |
commit | 6706bdc6964c5d820ae1547fba1e4b3fd3a39857 (patch) | |
tree | 2ac2e606b23b22ed6056afd716f203338a24de3c | |
parent | * src/jlib.hrl: Added declaration of "iq" record (diff) |
* src/mod_roster.erl: Added workaround for legacy gateways
(passing of "subscribed" presence)
* src/ejabberd_sm.erl: Minor fix in subscription processing
SVN Revision: 187
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/ejabberd_sm.erl | 9 | ||||
-rw-r--r-- | src/mod_roster.erl | 6 |
3 files changed, 15 insertions, 7 deletions
@@ -1,3 +1,10 @@ +2003-12-21 Alexey Shchepin <alexey@sevcom.net> + + * src/mod_roster.erl: Added workaround for legacy gateways + (passing of "subscribed" presence) + + * src/ejabberd_sm.erl: Minor fix in subscription processing + 2003-12-17 Alexey Shchepin <alexey@sevcom.net> * src/jlib.hrl: Added declaration of "iq" record diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 6fc8f1fd..03d1cac9 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -150,27 +150,26 @@ do_route(From, To, Packet) -> "" -> case Name of "presence" -> - FromU = jlib:jid_replace_resource(From, ""), {Pass, Subsc} = case xml:get_attr_s("type", Attrs) of "subscribe" -> {mod_roster:in_subscription(User, - FromU, + From, subscribe), true}; "subscribed" -> {mod_roster:in_subscription(User, - FromU, + From, subscribed), true}; "unsubscribe" -> {mod_roster:in_subscription(User, - FromU, + From, unsubscribe), true}; "unsubscribed" -> {mod_roster:in_subscription(User, - FromU, + From, unsubscribed), true}; _ -> diff --git a/src/mod_roster.erl b/src/mod_roster.erl index 2d0e8882..6f3234e6 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -397,7 +397,8 @@ process_subscription(Direction, User, JID1, Type) -> %% NewState = none | {NewSubscription, NewPending} in_state_change(none, none, subscribe) -> {none, in}; -in_state_change(none, none, subscribed) -> none; +in_state_change(none, none, subscribed) -> {to, none}; % Workaround for gateways +%in_state_change(none, none, subscribed) -> none; in_state_change(none, none, unsubscribe) -> none; in_state_change(none, none, unsubscribed) -> none; in_state_change(none, out, subscribe) -> {none, both}; @@ -405,7 +406,8 @@ in_state_change(none, out, subscribed) -> {to, none}; in_state_change(none, out, unsubscribe) -> none; in_state_change(none, out, unsubscribed) -> {none, none}; in_state_change(none, in, subscribe) -> none; -in_state_change(none, in, subscribed) -> none; +in_state_change(none, in, subscribed) -> {to, in}; % Workaround for gateways +%in_state_change(none, in, subscribed) -> none; in_state_change(none, in, unsubscribe) -> {none, none}; in_state_change(none, in, unsubscribed) -> none; in_state_change(none, both, subscribe) -> none; |