11#ifndef __NIM_QCHAT_CLIENT_CPP_DEF_H__
12#define __NIM_QCHAT_CLIENT_CPP_DEF_H__
35 c_resp.
appkey =
const_cast<char*
>(appkey.c_str());
36 c_resp.
accid =
const_cast<char*
>(accid.c_str());
37 c_resp.
token =
const_cast<char*
>(token.c_str());
47 std::string device_id{
""};
49 std::string client_ip{
""};
51 uint16_t client_port{0};
53 std::string consid{
""};
55 uint64_t timestamp{0};
57 uint32_t custom_client_type{0};
59 std::string custom_tag{
""};
61 std::string os_name{
""};
77 c_param.
device_id =
const_cast<char*
>(device_id.c_str());
78 c_param.
client_ip =
const_cast<char*
>(client_ip.c_str());
80 c_param.
consid_ =
const_cast<char*
>(consid.c_str());
83 c_param.
custom_tag_ =
const_cast<char*
>(custom_tag.c_str());
84 c_param.
os_name_ =
const_cast<char*
>(os_name.c_str());
92 uint32_t client_type{0};
94 uint32_t kick_reason{0};
98 uint32_t custom_client_type{0};
103 ext = c_resp.
ext ? c_resp.
ext :
"";
111 NIMQChatLoginStatus login_status{kLoginStatusUnlogin};
119 uint32_t res_code{0};
121 uint32_t notify_type{0};
134 uint32_t res_code{0};
138 std::list<QChatLoginClientInfo> other_clients{};
154 uint32_t res_code{0};
162 uint32_t res_code{0};
164 std::list<std::string> kicked_device_ids{};
176 vec_kicked_device_ids.clear();
177 for (
auto&& device_id : kicked_device_ids)
178 vec_kicked_device_ids.push_back(
const_cast<char*
>(device_id.c_str()));
186 mutable std::vector<char*> vec_kicked_device_ids;
192 std::string log_content{
""};
214 c_response.token =
const_cast<char*
>(token.c_str());
215 c_response.ttl = ttl;
250 resp_holder = cb_holder(resp);
251 return resp_holder.ToCParam();
272 uint32_t nego_key_neca_key_version = 0;
280 uint32_t thumbnail_width = 150;
282 uint32_t thumbnail_height = 100;
284 bool auto_download_history_msg_attach_ =
false;
286 bool auto_download_image_thumb =
true;
288 bool auto_download_video_thumb =
true;
290 bool auto_download_image =
false;
292 bool auto_download_audio =
false;
294 bool auto_download_video =
false;
296 bool auto_download_file =
false;
298 NIMQChatFCSAuthenticationType fcs_auth_type = kNIMQChatFCSAuthenticationTypeToken;
308 bool enable_message_cache =
false;
314 std::string app_data_path{
""};
316 uint32_t custom_timeout{0};
318 uint32_t auth_timeout{0};
329 param.
app_data_path =
const_cast<char*
>(app_data_path.c_str());
417 std::string appkey{
""};
419 std::string accid{
""};
423 std::string login_token{
""};
425 std::string login_ext{
""};
427 std::list<std::string> link_address{};
431 link_address_json_array.clear();
438 param.
appkey =
const_cast<char*
>(appkey.c_str());
439 param.
accid =
const_cast<char*
>(accid.c_str());
441 param.
login_token =
const_cast<char*
>(login_token.c_str());
442 param.
login_ext =
const_cast<char*
>(login_ext.c_str());
443 param.
link_address =
const_cast<char*
>(link_address_json_array.c_str());
449 mutable std::string link_address_json_array;
473 std::list<std::string> device_ids{};
479 auto c_response = response.ToCParam();
481 c_callback(c_response);
487 vec_device_ids.clear();
488 for (
auto&& accid : device_ids)
489 vec_device_ids.push_back(
const_cast<char*
>(accid.c_str()));
494 InvokeCallback<KickCallback, NIMQChatKickResp>(resp);
501 mutable std::vector<char*> vec_device_ids;
509 std::string device_id{
""};
513 auto c_response = response.ToCParam();
515 c_callback(c_response);
524 InvokeCallback<GetRTCTokenCallback, NIMQChatGetRTCTokenResp>(resp);
526 param.
device_id =
const_cast<char*
>(device_id.c_str());
std::function< void(const QChatMultispotLoginResp &)> MultispotLoginCallback
多点登录回调
Definition: nim_qchat_client_cpp_def.h:227
std::function< void(const QChatLoginStatusResp &)> LoginStatusCallback
被踢回调
Definition: nim_qchat_client_cpp_def.h:225
std::function< QChatCustomTokenResp(const QChatCustomTokenResp &)> CustomTokenCallback
获取自定义token回调
Definition: nim_qchat_client_cpp_def.h:221
std::function< void(const QChatKickResp &)> KickCallback
踢掉自己其他端回调
Definition: nim_qchat_client_cpp_def.h:235
std::function< void(const QChatKickedResp &)> KickedCallback
被踢回调
Definition: nim_qchat_client_cpp_def.h:223
std::function< void(const QChatSDKLogResp &)> SDKLogCallback
SDK系统日志回调模板
Definition: nim_qchat_client_cpp_def.h:229
std::function< void(const QChatLogoutResp &)> LogoutCallback
登出回调
Definition: nim_qchat_client_cpp_def.h:233
std::function< void(const QChatLoginResp &)> LoginCallback
登录回调
Definition: nim_qchat_client_cpp_def.h:231
std::function< void(const QChatGetRTCTokenResp &)> GetRTCTokenCallback
获取RTC频道token回调
Definition: nim_qchat_client_cpp_def.h:237
bool StrListToJsonString(const std::list< std::string > &list, std::string &out)
将一个string类型的list组装成一个Json Array
Definition: nim_json_util.cpp:12
@ kNIMResSuccess
Definition: nim_chatroom_res_code_def.h:18
@ kNIMQChatCommEncryptionAlgorithmRC4
RC4 加密
Definition: nim_qchat_client_def.h:255
NIMQChatHandShakeType
Definition: nim_qchat_client_def.h:262
@ kNIMQChatHandShakeTypeMulti
支持配置多种对称与非对称加密算法
Definition: nim_qchat_client_def.h:264
@ kNIMQChatEncryptionAlgorithmRSA
RSA 加密
Definition: nim_qchat_client_def.h:244
NIMQChatLoginAuthType
Definition: nim_qchat_client_def.h:21
@ kNIMQChatLoginAuthTypeDefault
默认login token鉴权方式
Definition: nim_qchat_client_def.h:23
NIMQChatClientType
Definition: nim_qchat_client_def.h:31
Definition: nim_qchat_client_def.h:356
Definition: nim_qchat_client_def.h:107
char * appkey
appkey
Definition: nim_qchat_client_def.h:111
char * accid
accid
Definition: nim_qchat_client_def.h:113
char * token
将该指针指向零结尾的token字符串的起始地址
Definition: nim_qchat_client_def.h:115
char * nego_key_neca_key_partb
非对称加密算法 key
Definition: nim_qchat_client_def.h:281
NIMQChatCommEncryptionAlgorithm comm_neca
通信加密算法 {1(RC4),2(AES128),4(SM4)} def:1(RC4) 对称加密
Definition: nim_qchat_client_def.h:275
uint32_t nego_key_neca_key_version
非对称加密算法的 key version
Definition: nim_qchat_client_def.h:283
NIMQChatExchangeKeyEncryptionAlgorithm nego_key_neca
"交换密钥"协议加密算法
Definition: nim_qchat_client_def.h:273
NIMQChatHandShakeType hand_shake_type
握手协议类型 0:支持配置多种对称与非对称加密算法,1:只支持RAS + RC4
Definition: nim_qchat_client_def.h:277
char * nego_key_neca_key_parta
"交换密钥"协议加密算法密钥, 为空使用默认值
Definition: nim_qchat_client_def.h:279
bool auto_download_video
是否自动下载视频
Definition: nim_qchat_client_def.h:313
uint32_t thumbnail_width
缩略图宽度
Definition: nim_qchat_client_def.h:299
bool auto_download_image_thumb
是否自动下载图片缩略图
Definition: nim_qchat_client_def.h:305
bool auto_download_image
是否自动下载图片
Definition: nim_qchat_client_def.h:309
NIMQChatFCSAuthenticationType fcs_auth_type
下载附件类数据的鉴权方式
Definition: nim_qchat_client_def.h:317
uint32_t thumbnail_height
缩略图高度
Definition: nim_qchat_client_def.h:301
char * mock_refer
mock refer
Definition: nim_qchat_client_def.h:321
char * mock_ua
mock user-agent
Definition: nim_qchat_client_def.h:319
bool auto_download_history_msg_attach_
是否自动下载历史消息附件
Definition: nim_qchat_client_def.h:303
bool auto_download_file
是否自动下载文件
Definition: nim_qchat_client_def.h:315
bool auto_download_video_thumb
是否自动下载视频缩略图
Definition: nim_qchat_client_def.h:307
bool auto_download_audio
是否自动下载音频
Definition: nim_qchat_client_def.h:311
Definition: nim_qchat_client_def.h:407
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:411
nim_qchat_get_rtc_token_cb_func cb
获取RTC token回调
Definition: nim_qchat_client_def.h:409
char * device_id
device_id
Definition: nim_qchat_client_def.h:413
Definition: nim_qchat_client_def.h:173
uint32_t ttl
ttl, 单位秒
Definition: nim_qchat_client_def.h:181
char * token
token
Definition: nim_qchat_client_def.h:179
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:175
Definition: nim_qchat_client_def.h:338
char * app_data_path
APP 数据存储路径,如果为空,则使用系统默认路径
Definition: nim_qchat_client_def.h:340
NIMQChatMessageChacheConfiguration message_cache_configuration
圈组消息缓存配置
Definition: nim_qchat_client_def.h:352
char * database_encrypt_key
数据库加密密钥,如果为空,则使用默认值
Definition: nim_qchat_client_def.h:346
uint32_t custom_timeout
自定义通信超时时间,单位秒, 为 0 使用默认值
Definition: nim_qchat_client_def.h:342
NIMQChatEncryptionConfiguration encrypt_configuration
圈组协议加密配置
Definition: nim_qchat_client_def.h:348
uint32_t auth_timeout
自定义鉴权超时时间,单位秒, 为 0 使用默认值
Definition: nim_qchat_client_def.h:344
NIMQChatFCSConfiguration fcs_configuration
圈组云端数据存储配置信息
Definition: nim_qchat_client_def.h:350
Definition: nim_qchat_client_def.h:387
nim_qchat_kick_cb_func cb
踢掉自己其他端回调
Definition: nim_qchat_client_def.h:389
char ** device_ids
被踢的设备id
Definition: nim_qchat_client_def.h:393
void * user_data
自定义用户数据
Definition: nim_qchat_client_def.h:391
size_t device_ids_count
被踢的设备数量
Definition: nim_qchat_client_def.h:395
Definition: nim_qchat_client_def.h:161
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:163
char ** kicked_device_ids
被踢的设备id列表
Definition: nim_qchat_client_def.h:167
size_t kicked_device_ids_count
被踢的设备数量
Definition: nim_qchat_client_def.h:169
Definition: nim_qchat_client_def.h:85
NIMQChatClientType client_type
客户端类型
Definition: nim_qchat_client_def.h:89
uint32_t custom_client_type
自定义客户端类型
Definition: nim_qchat_client_def.h:95
char * ext
扩展字段
Definition: nim_qchat_client_def.h:93
uint32_t kick_reason
被踢原因
Definition: nim_qchat_client_def.h:91
Definition: nim_qchat_client_def.h:63
char * client_ip
客户端 IP
Definition: nim_qchat_client_def.h:69
char * os_name_
操作系统名称
Definition: nim_qchat_client_def.h:81
uint32_t custom_client_type_
自定义终端类型
Definition: nim_qchat_client_def.h:77
char * custom_tag_
自定义标签
Definition: nim_qchat_client_def.h:79
uint64_t timestamp
时间戳
Definition: nim_qchat_client_def.h:75
char * device_id
设备 ID
Definition: nim_qchat_client_def.h:67
uint16_t client_port
客户端端口
Definition: nim_qchat_client_def.h:73
NIMQChatClientType client_type
终端类型
Definition: nim_qchat_client_def.h:65
char * consid_
会话 ID
Definition: nim_qchat_client_def.h:71
Definition: nim_qchat_client_def.h:359
char * login_token
登陆的token
Definition: nim_qchat_client_def.h:371
char * login_ext
登录自定义字段
Definition: nim_qchat_client_def.h:373
nim_qchat_login_cb_func cb
登录异步回调
Definition: nim_qchat_client_def.h:361
char * accid
用户帐号
Definition: nim_qchat_client_def.h:367
char * appkey
app唯一标识符
Definition: nim_qchat_client_def.h:365
NIMQChatLoginAuthType auth_type
鉴权方式
Definition: nim_qchat_client_def.h:369
char * link_address
链接地址 json array
Definition: nim_qchat_client_def.h:375
Definition: nim_qchat_client_def.h:137
NIMQChatLoginClientInfo client_info
客户端信息
Definition: nim_qchat_client_def.h:145
NIMQChatLoginClientInfo * other_clients
其他客户端信息
Definition: nim_qchat_client_def.h:149
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:139
size_t other_clients_count
其他客户端数量
Definition: nim_qchat_client_def.h:147
Definition: nim_qchat_client_def.h:99
NIMQChatLoginStatus login_status
登录状态
Definition: nim_qchat_client_def.h:103
Definition: nim_qchat_client_def.h:379
nim_qchat_logout_cb_func cb
登出异步回调
Definition: nim_qchat_client_def.h:381
Definition: nim_qchat_client_def.h:153
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_def.h:155
bool enable_message_cache
是否开启缓存消息,默认开启
Definition: nim_qchat_client_def.h:330
Definition: nim_qchat_client_def.h:119
NIMQChatLoginClientInfo client_info
客户端信息
Definition: nim_qchat_client_def.h:125
uint32_t notify_type
通知类型 1:登录 2:登出
Definition: nim_qchat_client_def.h:123
Definition: nim_qchat_client_def.h:208
nim_qchat_custom_token_cb_func cb
自定义token回调
Definition: nim_qchat_client_def.h:210
Definition: nim_qchat_client_def.h:216
nim_qchat_kicked_cb_func cb
被踢异步回调
Definition: nim_qchat_client_def.h:218
Definition: nim_qchat_client_def.h:224
nim_qchat_login_status_cb_func cb
登录状态回调
Definition: nim_qchat_client_def.h:226
Definition: nim_qchat_client_def.h:232
nim_qchat_multispot_login_cb_func cb
多端登录异步回调
Definition: nim_qchat_client_def.h:234
Definition: nim_qchat_client_def.h:129
char * log_content
日志内容
Definition: nim_qchat_client_def.h:133
Definition: nim_qchat_client_cpp_def.h:405
Definition: nim_qchat_client_cpp_def.h:20
std::string appkey
appkey
Definition: nim_qchat_client_cpp_def.h:22
std::string token
自定义token
Definition: nim_qchat_client_cpp_def.h:26
std::string accid
accid
Definition: nim_qchat_client_cpp_def.h:24
Definition: nim_qchat_client_cpp_def.h:260
NIMQChatHandShakeType hand_shake_type
握手协议类型 0:支持配置多种对称与非对称加密算法,1:只支持RAS + RC4
Definition: nim_qchat_client_cpp_def.h:266
std::string nego_key_neca_key_partb
非对称加密算法 key
Definition: nim_qchat_client_cpp_def.h:270
uint32_t nego_key_neca_key_version
非对称加密算法的 key version
Definition: nim_qchat_client_cpp_def.h:272
std::string nego_key_neca_key_parta
"交换密钥"协议加密算法密钥, 为空使用默认值
Definition: nim_qchat_client_cpp_def.h:268
NIMQChatCommEncryptionAlgorithm comm_neca
通信加密算法 {1(RC4),2(AES128),4(SM4)} def:1(RC4) 对称加密
Definition: nim_qchat_client_cpp_def.h:264
NIMQChatExchangeKeyEncryptionAlgorithm nego_key_neca
"交换密钥"协议加密算法 {1(RSA),2(SM2)}, def:1(RSA) 非对称加密
Definition: nim_qchat_client_cpp_def.h:262
Definition: nim_qchat_client_cpp_def.h:278
uint32_t thumbnail_height
缩略图高度
Definition: nim_qchat_client_cpp_def.h:282
bool auto_download_audio
是否自动下载音频
Definition: nim_qchat_client_cpp_def.h:292
bool auto_download_history_msg_attach_
是否自动下载历史消息附件
Definition: nim_qchat_client_cpp_def.h:284
std::string mock_ua
mock user-agent
Definition: nim_qchat_client_cpp_def.h:300
bool auto_download_video
是否自动下载视频
Definition: nim_qchat_client_cpp_def.h:294
bool auto_download_image_thumb
是否自动下载图片缩略图
Definition: nim_qchat_client_cpp_def.h:286
bool auto_download_video_thumb
是否自动下载视频缩略图
Definition: nim_qchat_client_cpp_def.h:288
NIMQChatFCSAuthenticationType fcs_auth_type
下载附件类数据的鉴权方式
Definition: nim_qchat_client_cpp_def.h:298
std::string mock_refer
mock refer
Definition: nim_qchat_client_cpp_def.h:302
bool auto_download_image
是否自动下载图片
Definition: nim_qchat_client_cpp_def.h:290
uint32_t thumbnail_width
缩略图宽度
Definition: nim_qchat_client_cpp_def.h:280
bool auto_download_file
是否自动下载文件
Definition: nim_qchat_client_cpp_def.h:296
Definition: nim_qchat_client_cpp_def.h:505
Definition: nim_qchat_client_cpp_def.h:198
uint32_t res_code
操作结果, 参考NIMResCode
Definition: nim_qchat_client_cpp_def.h:200
std::string token
token
Definition: nim_qchat_client_cpp_def.h:202
Definition: nim_qchat_client_cpp_def.h:312
QChatEncryptionConfiguration encryption_configuration
加密配置
Definition: nim_qchat_client_cpp_def.h:322
QChatFCSConfiguration fcs_configuration
FCS配置
Definition: nim_qchat_client_cpp_def.h:324
std::string database_encrypt_key
数据库加密密钥,如果为空,则使用默认值
Definition: nim_qchat_client_cpp_def.h:320
QChatMessageCacheConfiguration message_cache_configuration
消息缓存配置
Definition: nim_qchat_client_cpp_def.h:326
Definition: nim_qchat_client_cpp_def.h:469
Definition: nim_qchat_client_cpp_def.h:160
Definition: nim_qchat_client_cpp_def.h:90
Definition: nim_qchat_client_cpp_def.h:43
Definition: nim_qchat_client_cpp_def.h:413
Definition: nim_qchat_client_cpp_def.h:132
Definition: nim_qchat_client_cpp_def.h:109
Definition: nim_qchat_client_cpp_def.h:453
Definition: nim_qchat_client_cpp_def.h:152
Definition: nim_qchat_client_cpp_def.h:306
bool enable_message_cache
是否开启缓存消息,默认不开启
Definition: nim_qchat_client_cpp_def.h:308
Definition: nim_qchat_client_cpp_def.h:117
Definition: nim_qchat_client_cpp_def.h:240
Definition: nim_qchat_client_cpp_def.h:357
Definition: nim_qchat_client_cpp_def.h:373
Definition: nim_qchat_client_cpp_def.h:389
Definition: nim_qchat_client_cpp_def.h:190