api: Implement POST /messages/flags.
This commit is contained in:
parent
c2fdd547f7
commit
a96c3f0db0
2 changed files with 37 additions and 0 deletions
26
zulip/zulip/examples/update-flags
Executable file
26
zulip/zulip/examples/update-flags
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import argparse
|
||||
|
||||
import zulip
|
||||
|
||||
usage = """update-flags (add | remove) <flag> <message_id1> [more_message_ids]
|
||||
|
||||
Example: update-flags add read 4 8 15
|
||||
Example: update-flags remove starred 16 23 42
|
||||
"""
|
||||
|
||||
parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage))
|
||||
parser.add_argument('op', choices=['add', 'remove'])
|
||||
parser.add_argument('flag')
|
||||
parser.add_argument('messages', type=int, nargs='+')
|
||||
options = parser.parse_args()
|
||||
|
||||
client = zulip.init_from_options(options)
|
||||
|
||||
print(client.update_message_flags({
|
||||
'op': options.op,
|
||||
'flag': options.flag,
|
||||
'messages': options.messages
|
||||
}))
|
Loading…
Add table
Add a link
Reference in a new issue