Exemplo n.º 1
0
        /// <summary>
        /// 在线查询指定帐号的用户名片
        /// </summary>
        /// <param name="accountIdList"></param>
        /// <param name="resultDelegate"></param>
        public static void QueryUserNameCardOnline(List <string> accountIdList, GetUserNameCardResultDelegate resultDelegate)
        {
            var idJsonParam = NimUtility.Json.JsonParser.Serialize(accountIdList);
            var ptr         = NimUtility.DelegateConverter.ConvertToIntPtr(resultDelegate);

            UserNativeMethods.nim_user_get_user_name_card_online(idJsonParam, null, GetUserNameCardCompleted, ptr);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新用户名片
        /// </summary>
        /// <param name="card"></param>
        /// <param name="d"></param>
        public static void UpdateMyCard(UserNameCard card, UpdateNameCardResultDelegate d)
        {
            var json = card.Serialize();
            var ptr  = NimUtility.DelegateConverter.ConvertToIntPtr(d);

            UserNativeMethods.nim_user_update_my_user_name_card(json, null, UpdateNameCardCompleted, ptr);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     获取本地的指定帐号的用户名片
        /// </summary>
        /// <param name="accountIdList"></param>
        /// <param name="resultDelegate"></param>
        public static void GetUserNameCard(List <string> accountIdList, GetUserNameCardResultDelegate resultDelegate)
        {
            var idJsonParam = JsonParser.Serialize(accountIdList);
            var ptr         = DelegateConverter.ConvertToIntPtr(resultDelegate);

            UserNativeMethods.nim_user_get_user_name_card(idJsonParam, null, _getUserNameCardCompleted, ptr);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 设置、取消设置黑名单.
 /// </summary>
 /// <param name="accountId"> 好友id.</param>
 /// <param name="inBlacklist">if set to <c>true</c> [set_black].</param>
 /// <param name="cb">操作结果回调.</param>
 public static void SetBlacklist(string accountId, bool inBlacklist, UserOperationDelegate cb)
 {
     UserNativeMethods.nim_user_set_black(accountId, inBlacklist, null, cb, IntPtr.Zero);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 统一注册用户属性变更通知回调函数(本地、多端同步黑名单、静音名单变更)
 /// </summary>
 /// <param name="cb">操作结果回调</param>
 private static void RegSpecialRelationshipChangedCb()
 {
     UserNativeMethods.nim_user_reg_special_relationship_changed_cb(null, OnRelationshipChanged, IntPtr.Zero);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 统一注册用户名片变更通知回调函数
 /// </summary>
 private static void RegUserNameCardChangedCb()
 {
     UserNativeMethods.nim_user_reg_user_name_card_changed_cb(null, UserNameCardChanged, IntPtr.Zero);
 }
Exemplo n.º 7
0
        /// <summary>
        /// 获取用户关系列表(黑名单和静音列表)
        /// </summary>
        /// <param name="resultDelegate"></param>
        public static void GetRelationshipList(GetUserRelationshipResuleDelegate resultDelegate)
        {
            var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(resultDelegate);

            UserNativeMethods.nim_user_get_mute_blacklist("Blacklist", SyncMutedAndBlacklistCompleted, ptr);
        }
Exemplo n.º 8
0
 /// <summary>
 /// 设置、取消设置静音名单
 /// </summary>
 /// <param name="accountId">好友id</param>
 /// <param name="isMuted">取消或设置</param>
 /// <param name="cb">操作结果回调</param>
 public static void SetUserMuted(string accountId, bool isMuted, UserOperationDelegate cb)
 {
     UserNativeMethods.nim_user_set_mute(accountId, isMuted, null, cb, IntPtr.Zero);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 更新推送证书名和token
 /// </summary>
 /// <param name="certificateName">在云信管理后台配置的证书名</param>
 /// <param name="token">推送token</param>
 /// <param name="type">仅iOS需要 1 表示pushkit,0 表示apns</param>
 public static void UpdatePushToken(string certificateName, string token, int type)
 {
     UserNativeMethods.nim_user_update_push_token(certificateName, token, type);
 }
Exemplo n.º 10
0
        /// <summary>
        ///     设置、取消设置静音名单
        /// </summary>
        /// <param name="accountId">好友id</param>
        /// <param name="isMuted">取消或设置</param>
        /// <param name="cb">操作结果回调</param>
        public static void SetUserMuted(string accountId, bool isMuted, UserOperationDelegate cb)
        {
            var ptr = DelegateConverter.ConvertToIntPtr(cb);

            UserNativeMethods.nim_user_set_mute(accountId, isMuted, null, ModifyMutedlistDelegate, ptr);
        }
Exemplo n.º 11
0
        /// <summary>
        ///     设置、取消设置黑名单.
        /// </summary>
        /// <param name="accountId"> 好友id.</param>
        /// <param name="inBlacklist">if set to <c>true</c> [set_black].</param>
        /// <param name="cb">操作结果回调.</param>
        public static void SetBlacklist(string accountId, bool inBlacklist, UserOperationDelegate cb)
        {
            var ptr = DelegateConverter.ConvertToIntPtr(cb);

            UserNativeMethods.nim_user_set_black(accountId, inBlacklist, null, ModifyBlacklistDelegate, ptr);
        }