]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_sm.erl: Added set_presence_hook
authorAlexey Shchepin <alexey@process-one.net>
Thu, 3 May 2007 15:45:24 +0000 (15:45 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Thu, 3 May 2007 15:45:24 +0000 (15:45 +0000)
* src/ejabberd_c2s.erl: Likewise

SVN Revision: 761

ChangeLog
src/ejabberd_c2s.erl
src/ejabberd_sm.erl

index 0f23f225a5a0803f7ffdff1977adeff8f31961a5..28f05c851bc95f4cac1d66119e71a4a635042040 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2007-05-03  Alexey Shchepin  <alexey@sevcom.net>
 
        * src/ejabberd_sm.erl: Added set_presence_hook
+       * src/ejabberd_c2s.erl: Likewise
 
        * src/ejabberd_sm.erl: Added check for existence of incoming
        subscription destination
index bf4a3ac05e580dd1024dfce6bc1e51e21aa1e291..98232cf0908e9ef8deb831f672b1e8f88625cb7a 100644 (file)
@@ -1362,7 +1362,7 @@ presence_update(From, Packet, StateData) ->
                                  get_priority_from_presence(OldPresence)
                          end,
            NewPriority = get_priority_from_presence(Packet),
-           update_priority(NewPriority, StateData),
+           update_priority(NewPriority, Packet, StateData),
            FromUnavail = (StateData#state.pres_last == undefined) or
                StateData#state.pres_invis,
            ?DEBUG("from unavail = ~p~n", [FromUnavail]),
@@ -1641,12 +1641,13 @@ roster_change(IJID, ISubscription, StateData) ->
     end.
 
 
-update_priority(Pri, StateData) ->
+update_priority(Priority, Packet, StateData) ->
     ejabberd_sm:set_presence(StateData#state.sid,
                             StateData#state.user,
                             StateData#state.server,
                             StateData#state.resource,
-                            Pri).
+                            Priority,
+                            Packet).
 
 get_priority_from_presence(PresencePacket) ->
     case xml:get_subtag(PresencePacket, "priority") of
index cfc1bb957dca486044eeffab30b6b903c61adbbe..fc1706da36be13547f817139049dd73b1081f6f8 100644 (file)
@@ -19,7 +19,7 @@
         bounce_offline_message/3,
         disconnect_removed_user/2,
         get_user_resources/2,
-        set_presence/5,
+        set_presence/6,
         unset_presence/5,
         close_session_unset_presence/5,
         dirty_get_sessions_list/0,
@@ -110,10 +110,10 @@ get_user_resources(User, Server) ->
            [element(3, S#session.usr) || S <- clean_session_list(Ss)]
     end.
 
-set_presence(SID, User, Server, Resource, Priority) ->
+set_presence(SID, User, Server, Resource, Priority, Presence) ->
     set_session(SID, User, Server, Resource, Priority),
     ejabberd_hooks:run(set_presence_hook, jlib:nameprep(Server),
-                      [User, Server, Resource, Priority]).
+                      [User, Server, Resource, Presence]).
 
 unset_presence(SID, User, Server, Resource, Status) ->
     set_session(SID, User, Server, Resource, undefined),