The "social dynamic" is needed, because I cannot pass real user id (via HTTP) to SQL queries.
Instead I pass social network type "social" (like 100 is facebook, 200 is twitter) and the social network id "sid" returned by that network. This way noone can read chats by other users, by just replacing the numeric "uid"...