[sr-dev] pres_update_watchers/pres_refresh_watchers questions

Juha Heinanen jh at tutpro.com
Sat Oct 1 13:32:41 CEST 2011


presence/README has:

4.4.  pres_refresh_watchers(uri, event, type)
     ...
     * type - it distinguishes between the two different types of events
       that can trigger the refresh, depending on its value:
          + 0 - a change in watchers authentication.
          + 1 - a statical update in published state (either through
            direct update in db table or by modifying the pidf
            manipulation document, if pidf_manipulation parameter is set).

4.5.  pres_update_watchers(uri, event)

   The function can be used in configuration to triger updates to watchers
   status if a change in watchers authorization state occurred (i.e.,
   updates of xcap documents change state from pending to active).	    

then in xcap_server/README there is an example where these two functions
are used:

        switch($rm) {
            case "PUT":
                xcaps_put("$var(uri)", "$hu", "$rb");
                if($xcapuri(u=>auid)=~"pres-rules")
                {
                    pres_update_watchers("$var(uri)", "presence");
                    pres_refresh_watchers("$var(uri)", "presence", 1);
                }
                exit;
            break;
            case "GET":
                xcaps_get("$var(uri)", "$hu");
                exit;
            break;
            case "DELETE":
                xcaps_del("$var(uri)", "$hu");
                if($xcapuri(u=>auid)=~"pres-rules")
                {
                    pres_update_watchers("$var(uri)", "presence");
                    pres_refresh_watchers("$var(uri)", "presence", 1);
                }
                exit;
            break;
        }

in PUT and DELETE, why type param value is 1 in pres_refresh_watchers
calls, because xcap operations do not update published state of
presentity?

in DELETE, why pres_update_watchers is called, because xcap delete
cannot change watchers status from pending to active?

-- juha



More information about the sr-dev mailing list