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); } }
/// <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); }