Hello Can someone tell me couple of details about presence code? I.e.:
1. There's PUBL_TYPE and WINFO_TYPE define. They are used as flags, but then they are just marking winfo / other packages. What's the effect of PUBL_TYPE on event package exactly? 2. What is the meaning of 'get_rules_doc', 'apply_auth_nbody', 'get_auth_status' funcs?
Unfortunately I wasn't able figure it out from source completely.
Thanks Stanisław Pitucha
Hello,
1. As described in http://www.ietf.org/rfc/rfc3857.txt , there is the possiblity to subscribe for watcher info for a package. The two flags refer to the type of subscription, their name cames for the source of the notified info - either from Publish or from info about watchers. Presence, for example, allows Subscriptions for presence.winfo. In this case two registrations are required in presence module (this is done from presence_xml module). For the *.winfo event little specifications are required, as the format is the same for all event packages and the presence module deals with handling subscribe request and generating notifies. The registration is in fact used only to signal to the presence module that it has to handle the winfo for that event.
2. For the event itself however, there are issues with authorizations- who can see my presence - and therefore in some cases (presence for example) all the fields in the structure must be filled in. The pres_ev_t structure follows the needs of presence event package, but it should be general enough to allow handling of any event package. First, you have the 'req_auth' filed which marks is authorization is required for that event. If this is set to 0, none of the fieldes you mentioned should not be filled in. If it is, then you should fill at least some of the fields. The idea is that the authorization is decided according to some document , that is also used for trimming the Notified body , if this is required. To improve performances(it is about one query in db instead of two for presence), the 'get_rules_doc' function is used first, returning a pointer to the rules_doc that is memorized in the presence module. It then gives this pointer as a parameter to the functions calculating the authorization status of a certain watcher, and then to the function trimming the body. This works well in case of presence, but it can be a bit restrictive if there are event packages that require different documents for the 2 actions. None reported until now, so we keep this configuration. Hope this made things clearer.
Regards, Anca Vamanu
Stanisław Pitucha wrote:
Hello Can someone tell me couple of details about presence code? I.e.:
- There's PUBL_TYPE and WINFO_TYPE define. They are used as flags, but then they are just marking winfo / other packages. What's the effect of
PUBL_TYPE on event package exactly? 2. What is the meaning of 'get_rules_doc', 'apply_auth_nbody', 'get_auth_status' funcs?
Unfortunately I wasn't able figure it out from source completely.
Thanks Stanisław Pitucha
Users mailing list Users@lists.openser.org http://lists.openser.org/cgi-bin/mailman/listinfo/users