File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:json_annotation/json_annotation.dart' ;
2
2
3
+ import '../../basic.dart' ;
3
4
import '../core.dart' ;
4
5
import '../model/model.dart' ;
5
6
@@ -34,6 +35,21 @@ class GetOwnUserResult {
34
35
Map <String , dynamic > toJson () => _$GetOwnUserResultToJson (this );
35
36
}
36
37
38
+ /// https://zulip.com/api/update-status
39
+ Future <void > updateStatus (ApiConnection connection, {
40
+ required UserStatusChange change,
41
+ }) {
42
+ return connection.post ('updateStatus' , (_) {}, 'users/me/status' , {
43
+ if (change.text case OptionSome (: var value))
44
+ 'status_text' : RawParameter (value ?? '' ),
45
+ if (change.emoji case OptionSome (: var value)) ...{
46
+ 'emoji_name' : RawParameter (value? .emojiName ?? '' ),
47
+ 'emoji_code' : RawParameter (value? .emojiCode ?? '' ),
48
+ 'reaction_type' : RawParameter (value? .reactionType.toJson () ?? '' ),
49
+ }
50
+ });
51
+ }
52
+
37
53
/// https://zulip.com/api/update-presence
38
54
///
39
55
/// Passes true for `slim_presence` to avoid getting an ancient data format
You can’t perform that action at this time.
0 commit comments