SendWho/WHO_LIST_UPDATE: add a cookie, ftlog...
When sending:
bIsBlocked = SendWho(sQuery, xCookie);
- bIsBlocked: true if the /who is ignored due to being less than 5s since the previous (not necessary, but would spare some hooksecurefunc("SendWho", SomeoneSentAWhoStoreTimeFunction); )
- xCookie: any random blurp (most sensible would be sender information, addon name or anything), the blurp should be a string or number to store locally, only a reference to it need be sent to the server; if that's too much work, then a server determined xCookie should be returned
When WHO_LIST_UPDATE is received, arg1 should be set to the xCookie. Then:
local arg1 = ...;
if (arg1 == MyOwnVerySpecialCookie) then
-- yay, ours! evaluate result
end
Would go a long way, not having to unregister/re-register WHO_LIST_UPDATE on the FriendsFrame to send a background SendWho, especially if multiple addons want to, and to be able to know if the response is actually the one to the query that the local code assumes.
Obviously, the FriendsFrame should itself as well send and honor a cookie.
|