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 11import 'package:json_annotation/json_annotation.dart' ;
22
3+ import '../../basic.dart' ;
34import '../core.dart' ;
45import '../model/model.dart' ;
56
@@ -34,6 +35,21 @@ class GetOwnUserResult {
3435 Map <String , dynamic > toJson () => _$GetOwnUserResultToJson (this );
3536}
3637
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+
3753/// https://zulip.com/api/update-presence
3854///
3955/// Passes true for `slim_presence` to avoid getting an ancient data format
You can’t perform that action at this time.
0 commit comments