NIMUser.h
3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
//
// NIMUser.h
// NIMLib
//
// Created by Netease.
// Copyright (c) 2015 Netease. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class NIMUserInfo;
/**
* 好友操作类型
*/
typedef NS_ENUM(NSInteger, NIMUserOperation){
/**
* 添加好友
* @discussion 直接添加为好友,无需验证
*/
NIMUserOperationAdd = 1,
/**
* 请求添加好友
*/
NIMUserOperationRequest = 2,
/**
* 通过添加好友请求
*/
NIMUserOperationVerify = 3,
/**
* 拒绝添加好友请求
*/
NIMUserOperationReject = 4,
};
/**
* 用户性别
*/
typedef NS_ENUM(NSInteger, NIMUserGender) {
/**
* 未知性别
*/
NIMUserGenderUnknown,
/**
* 性别男
*/
NIMUserGenderMale,
/**
* 性别女
*/
NIMUserGenderFemale,
};
/**
* 云信用户
*/
@interface NIMUser : NSObject
/**
* 用户Id
*/
@property (nullable,nonatomic,copy) NSString *userId;
/**
* 备注名,长度限制为128个字符。
*/
@property (nullable,nonatomic,copy) NSString *alias;
/**
* 扩展字段
*/
@property (nullable,nonatomic,copy) NSString *ext;
/**
* 用户资料,仅当用户选择托管信息到云信时有效
* 用户资料除自己之外,不保证其他用户资料实时更新
* 其他用户资料更新的时机为: 1.调用 - (void)fetchUserInfos:completion: 方法刷新用户
* 2.收到此用户发来消息
* 3.程序再次启动,此时会同步好友信息
*/
@property (nullable,nonatomic,strong,readonly) NIMUserInfo *userInfo;
/**
* 是否需要消息提醒
*
* @return 是否需要消息提醒
*/
- (BOOL)notifyForNewMsg;
/**
* 是否在黑名单中
*
* @return 是否在黑名单中
*/
- (BOOL)isInMyBlackList;
@end
/**
* 用户资料,仅当用户选择托管信息到云信时有效
*/
@interface NIMUserInfo : NSObject
/**
* 用户昵称
*/
@property (nullable,nonatomic,copy,readonly) NSString *nickName;
/**
* 用户头像
*/
@property (nullable,nonatomic,copy,readonly) NSString *avatarUrl;
/**
* 用户头像缩略图
* @discussion 仅适用于使用云信上传服务进行上传的资源,否则无效。
*/
@property (nullable,nonatomic,copy,readonly) NSString *thumbAvatarUrl;
/**
* 用户签名
*/
@property (nullable,nonatomic,copy,readonly) NSString *sign;
/**
* 用户性别
*/
@property (nonatomic,assign,readonly) NIMUserGender gender;
/**
* 邮箱
*/
@property (nullable,nonatomic,copy,readonly) NSString *email;
/**
* 生日
*/
@property (nullable,nonatomic,copy,readonly) NSString *birth;
/**
* 电话号码
*/
@property (nullable,nonatomic,copy,readonly) NSString *mobile;
/**
* 用户自定义扩展字段
*/
@property (nullable,nonatomic,copy,readonly) NSString *ext;
@end
/**
* 好友请求
*/
@interface NIMUserRequest : NSObject
/**
* 目标用户ID
*/
@property (nonatomic,copy) NSString *userId;
/**
* 操作类型
*/
@property (nonatomic,assign) NIMUserOperation operation;
/**
* 附言
*/
@property (nullable,nonatomic,copy) NSString *message;
@end
NS_ASSUME_NONNULL_END