NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim_user_def.h 文件参考

用户数据 接口相关的常量函数等定义头文件 更多...

#include "nim_global_def.h"
#include "public_defines.h"

浏览源代码.

类型定义

typedef void(* nim_user_special_relationship_change_cb_func) (enum NIMUserSpecialRelationshipChangeType type, const char *result_json, const char *json_extension, const void *user_data)
 
typedef void(* nim_user_opt_cb_func) (int res_code, const char *accid, bool opt, const char *json_extension, const void *user_data)
 
typedef void(* nim_user_sync_muteandblacklist_cb_func) (int res_code, const char *black_list_json, const char *json_extension, const void *user_data)
 
typedef void(* nim_user_name_card_change_cb_func) (const char *result_json, const char *json_extension, const void *user_data)
 
typedef void(* nim_user_get_user_name_card_cb_func) (const char *result_json, const char *json_extension, const void *user_data)
 
typedef void(* nim_user_update_my_name_card_cb_func) (int res_code, const char *json_extension, const void *user_data)
 

枚举

enum  NIMUserSpecialRelationshipChangeType { kNIMUserSpecialRelationshipChangeTypeMarkBlack = 1 , kNIMUserSpecialRelationshipChangeTypeMarkMute = 2 , kNIMUserSpecialRelationshipChangeTypeSyncMuteAndBlackList = 3 }
 
enum  NIMUserQueryType { kNIMUserQueryDefault = 0 , kNIMUserQueryByAccId = 1 , kNIMUserQueryByNickname = 2 }
 

变量

用户特殊关系(黑名单、静音名单) Json Keys

例子 [{"accid" : "litianyi01","is_mute" : 1},{"accid" : "litianyi03","is_black" : 1},...]

static const char * kNIMSpecialRelationKeyAccid = "accid"
 string, 用户帐号
 
static const char * kNIMSpecialRelationKeyIsMute = "is_mute"
 bool, 是静音帐号
 
static const char * kNIMSpecialRelationKeyIsBlackList = "is_black"
 bool, 是黑名单帐号
 
static const char * kNIMSpecialRelationKeyCreateTime = "create_timetag"
 long, 记录创建时间
 
static const char * kNIMSpecialRelationKeyUpdateTime = "update_timetag"
 long, 记录更新时间
 
用户名片 Json Keys

例子 { "accid" : "litianyi01", "create_timetag" : 1430101821372, "gender" : 0, "name" : "oleg01", "update_timetag" : 1430101821372 }

static const char * kNIMNameCardKeyAccid = "accid"
 string 帐号
 
static const char * kNIMNameCardKeyName = "name"
 string 昵称
 
static const char * kNIMNameCardKeyIcon = "icon"
 string 头像
 
static const char * kNIMNameCardKeySign = "sign"
 string 签名
 
static const char * kNIMNameCardKeyGender = "gender"
 int 性别
 
static const char * kNIMNameCardKeyEmail = "email"
 string 邮箱
 
static const char * kNIMNameCardKeyBirth = "birth"
 string 生日
 
static const char * kNIMNameCardKeyMobile = "mobile"
 string 电话
 
static const char * kNIMNameCardKeyEx = "ex"
 string 扩展字段, 必须为可以解析为json的非格式化的字符串
 
static const char * kNIMNameCardKeyCreateTime = "create_timetag"
 long 创建时间戳 毫秒
 
static const char * kNIMNameCardKeyUpdateTime = "update_timetag"
 long 更新时间戳 毫秒
 

详细描述

用户数据 接口相关的常量函数等定义头文件

作者
Harrison
日期
2015/2/1

类型定义说明

◆ nim_user_get_user_name_card_cb_func

void(* nim_user_get_user_name_card_cb_func)(const char *result_json,const char *json_extension, const void *user_data)

获取用户名片回调函数

参数
[out]result_jsonjson object array 例 [{ "accid" : "litianyi01", "create_timetag" : 1430101821372, "gender" : 0, "name" : "oleg01", "update_timetag" : 1430101821372 }, ...]
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
返回
void 无返回值

◆ nim_user_name_card_change_cb_func

void(* nim_user_name_card_change_cb_func)(const char *result_json,const char *json_extension, const void *user_data)

用户名片的监听回调函数定义

参数
[out]result_jsonjson object array 例 [{ "accid" : "litianyi01", "create_timetag" : 1430101821372, "gender" : 0, "name" : "oleg01", "update_timetag" : 1430101821372 }, ...]
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
返回
void 无返回值

◆ nim_user_opt_cb_func

void(* nim_user_opt_cb_func)(int res_code, const char *id, bool opt, const char *json_extension, const void *user_data)

用户操作(加黑或取消加黑,加静音或取消静音)的回调函数定义

参数
[out]res_code结果代码,一切正常200
[out]accid好友id
[out]optmark(加黑或取消加黑,加静音或取消静音)
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
返回
void 无返回值

◆ nim_user_special_relationship_change_cb_func

void(* nim_user_special_relationship_change_cb_func)(enum NIMUserSpecialRelationshipChangeType type, const char *result_json, const char *json_extension, const void *user_data)

用户多端同步类型(黑名单、静音名单)的监听回调函数定义

参数
[out]typeNIMUserSpecialRelationshipChangeType,用户多端同步类型
[out]result_json同步内容,kNIMUserSpecialRelationshipChangeTypeMarkBlack: {"accid" : "abc", "black" : bool} , kNIMUserSpecialRelationshipChangeTypeMarkMute: {"accid" : "abc", "mute" : bool}, kNIMUserSpecialRelationshipChangeTypeSyncMuteAndBlackList: {a, b, c ...}(a,b,c为json value array - 用户特殊关系(黑名单、静音名单) Json Keys)
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
返回
void 无返回值

◆ nim_user_sync_muteandblacklist_cb_func

void(* nim_user_sync_muteandblacklist_cb_func)(int res_code, const char *black_list_json, const char *json_extension, const void *user_data)

获取黑名单、静音列表

参数
[out]res_code结果代码,一切正常200
[out]black_list_json黑名单和静音列表Json字符串({a , b , ...}(a,b,c为json value array - 用户特殊关系(黑名单、静音名单) Json Keys))
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
返回
void 无返回值

◆ nim_user_update_my_name_card_cb_func

void(* nim_user_update_my_name_card_cb_func)(int res_code, const char *accid, const char *json_extension, const void *user_data)

更新自己的用户名片回调函数

参数
[out]res_code结果代码,一切正常200
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
返回
void 无返回值

枚举类型说明

◆ NIMUserQueryType

查询用户信息条件选项

枚举值
kNIMUserQueryDefault 

查询默认条件,将匹配账户ID和昵称

kNIMUserQueryByAccId 

仅匹配账户ID

kNIMUserQueryByNickname 

仅匹配用户昵称

◆ NIMUserSpecialRelationshipChangeType

用户特殊关系数据变更类型

枚举值
kNIMUserSpecialRelationshipChangeTypeMarkBlack 

添加删除黑名单

kNIMUserSpecialRelationshipChangeTypeMarkMute 

添加删除静音名单

kNIMUserSpecialRelationshipChangeTypeSyncMuteAndBlackList 

同步黑名单和静音名单

变量说明

◆ kNIMNameCardKeyAccid

const char* kNIMNameCardKeyAccid = "accid"
static

string 帐号

◆ kNIMNameCardKeyBirth

const char* kNIMNameCardKeyBirth = "birth"
static

string 生日

◆ kNIMNameCardKeyCreateTime

const char* kNIMNameCardKeyCreateTime = "create_timetag"
static

long 创建时间戳 毫秒

◆ kNIMNameCardKeyEmail

const char* kNIMNameCardKeyEmail = "email"
static

string 邮箱

◆ kNIMNameCardKeyEx

const char* kNIMNameCardKeyEx = "ex"
static

string 扩展字段, 必须为可以解析为json的非格式化的字符串

◆ kNIMNameCardKeyGender

const char* kNIMNameCardKeyGender = "gender"
static

int 性别

◆ kNIMNameCardKeyIcon

const char* kNIMNameCardKeyIcon = "icon"
static

string 头像

◆ kNIMNameCardKeyMobile

const char* kNIMNameCardKeyMobile = "mobile"
static

string 电话

◆ kNIMNameCardKeyName

const char* kNIMNameCardKeyName = "name"
static

string 昵称

◆ kNIMNameCardKeySign

const char* kNIMNameCardKeySign = "sign"
static

string 签名

◆ kNIMNameCardKeyUpdateTime

const char* kNIMNameCardKeyUpdateTime = "update_timetag"
static

long 更新时间戳 毫秒

◆ kNIMSpecialRelationKeyAccid

const char* kNIMSpecialRelationKeyAccid = "accid"
static

string, 用户帐号

◆ kNIMSpecialRelationKeyCreateTime

const char* kNIMSpecialRelationKeyCreateTime = "create_timetag"
static

long, 记录创建时间

◆ kNIMSpecialRelationKeyIsBlackList

const char* kNIMSpecialRelationKeyIsBlackList = "is_black"
static

bool, 是黑名单帐号

◆ kNIMSpecialRelationKeyIsMute

const char* kNIMSpecialRelationKeyIsMute = "is_mute"
static

bool, 是静音帐号

◆ kNIMSpecialRelationKeyUpdateTime

const char* kNIMSpecialRelationKeyUpdateTime = "update_timetag"
static

long, 记录更新时间