Skip to content

setPrivacy

Sahri Riza Umami edited this page Mar 14, 2017 · 6 revisions

Changes privacy settings.

setPrivacy(key, rule, allowed_user_ids, disallowed_user_ids)
Option Description
key Privacy key. UserStatus is privacy key for managing visibility of the user status, and ChatInvite is privacy key for managing ability of invitation of the user to chats.
rules New privacy rules. AllowAll = allow all users, AllowContacts = allow all user contacts, AllowUsers = allow specified users (user_ids), DisallowAll = disallow all users, DisallowContacts = disallow all user contacts, and DisallowUsers = disallow all specified users (user_ids).

Example

  • Allow everybody, except user 133780085, to invite logged in user into a chat.

    setPrivacy('ChatInvite', 'AllowAll', nil, {[0] = 133780085})
  • Disallow everybody, except user 133780085 and 133761745, to see login status.

    setPrivacy('UserStatus', 'DisallowAll', {[0] = 133780085, 133761745}, nil)
  • Only allow user in contact list to invite into a group chat.

    setPrivacy('ChatInvite', 'AllowContacts', nil, nil)

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally