/// <summary> /// 更新好友资料 /// </summary> /// <param name="profile"></param> /// <param name="cb"></param> public static void UpdateFriendInfo(NIMFriendProfile profile, FriendOperationDelegate cb) { if (profile == null || string.IsNullOrEmpty(profile.AccountId)) { throw new ArgumentException("profile or accountid can't be null"); } string jsonParam = profile.Serialize(); FriendNativeMethods.nim_friend_update(jsonParam, null, cb, IntPtr.Zero); }
/// <summary> /// 更新好友资料 /// </summary> /// <param name="profile"></param> /// <param name="cb"></param> public static void UpdateFriendInfo(NIMFriendProfile profile, FriendOperationDelegate cb) { if (profile == null || string.IsNullOrEmpty(profile.AccountId)) { throw new ArgumentException("profile or accountid can't be null"); } var jsonParam = profile.Serialize(); IntPtr ptr = DelegateConverter.ConvertToIntPtr(cb); FriendNativeMethods.nim_friend_update(jsonParam, null, UpdateFriendDelegate, ptr); }
private static void OnGetFriendProfileCompleted(string accid, string profileJson, string jsonExtension, IntPtr userData) { if (userData != IntPtr.Zero) { NIMFriendProfile profile = null; if (!string.IsNullOrEmpty(profileJson)) { profile = NIMFriendProfile.Deserialize(profileJson); } NimUtility.DelegateConverter.Invoke <GetFriendProfileResultDelegate>(userData, accid, profile); } }