Set the user's friend list, group list, and user attributes in the User Logon success event, and send the data synchronization command:
- // Callback function definition for successful User Login
- Typedef void (callback * bras_onuserloginaction_callback) (DWORD dwuserid, lpctstr szusername, DWORD dwlevel, lpctstr szipaddr, lpvoid lpuservalue );
Copy code 1. Add a user group
- DWORD dwgroupid = 1;
- Bras_userinfocontrol (dwuserid, bras_userinfo_ctrlcode_addgroup, dwgroupid, 0, "my friends ");
- Dwgroupid = 2;
- Bras_userinfocontrol (dwuserid, bras_userinfo_ctrlcode_addgroup, dwgroupid, 0, "company colleague ");
Copy code 2. Add User friends
- DWORD dwfrienduserid = 10010;
- Bras_userinfocontrol (dwuserid, bras_userinfo_ctrlcode_addfriend, dwfrienduserid );
- Dwfrienduserid = 10011;
- Bras_userinfocontrol (dwuserid, bras_userinfo_ctrlcode_addfriend, dwfrienduserid );
Copy code 3. Set the relationship between friends and groups (that is, the group to which friends belong)
- DWORD dwgroupid = 1;
- DWORD dwfrienduserid = 10010;
- Bras_userinfocontrol (dwuserid, bras_userinfo_ctrlcode_setgrouprelation, dwgroupid, dwfrienduserid );
- Dwgroupid = 2;
- Dwfrienduserid = 10011;
- Bras_userinfocontrol (dwuserid, bras_userinfo_ctrlcode_setgrouprelation, dwgroupid, dwfrienduserid );
Copy code Iv. Set User Information (User Information)
- Bras_setuserinfo (dwuserid, 1, "my signature ");
- Bras_setuserinfo (dwuserid, 2, "020-85276986 ");
- ......
Copy code 5. Synchronize the information set above to the client
- Bras_userinfocontrol (dwuserid, bras_userinfo_ctrlcode_syncdata, 0, 0 );
Copy code |