Пример #1
0
        /// <summary>
        /// 修改其他成员的群昵称
        /// </summary>
        /// <param name="info"></param>
        /// <param name="action"></param>
        public static void UpdateMemberNickName(NIMTeamMemberInfo info, TeamChangedNotificationDelegate action)
        {
            var infoJson = info.Serialize();
            var ptr      = NimUtility.DelegateConverter.ConvertToIntPtr(action);

            TeamNativeMethods.nim_team_update_other_nick_async(infoJson, null, _teamChangedCallback, ptr);
        }
Пример #2
0
 private static void OnQuerySingleMemberCompleted(string tid, string userId, string result, string jsonExtension, IntPtr userData)
 {
     if (userData != IntPtr.Zero)
     {
         var info = NIMTeamMemberInfo.Deserialize(result);
         NimUtility.DelegateConverter.InvokeOnce <QuerySingleMemberResultDelegate>(userData, info);
     }
 }
Пример #3
0
        /// <summary>
        /// 查询(单个)群成员信息(同步版本,堵塞NIM内部线程,谨慎使用)
        /// </summary>
        /// <param name="tid"></param>
        /// <param name="uid"></param>
        /// <returns></returns>
        public static NIMTeamMemberInfo QuerySingleMemberInfo(string tid, string uid)
        {
            NIMTeamMemberInfo info = null;
            var ptr = TeamNativeMethods.nim_team_query_team_member_block(tid, uid);

            if (ptr != IntPtr.Zero)
            {
                NimUtility.Utf8StringMarshaler marshaler = new NimUtility.Utf8StringMarshaler();
                var infoObj = marshaler.MarshalNativeToManaged(ptr);
                info = NIMTeamMemberInfo.Deserialize(infoObj.ToString());
                GlobalAPI.FreeStringBuffer(ptr);
            }
            return(info);
        }