Add support for updating messages after they've been received.

Currently the interface for editing messages is limited to a
command-line API tool; it's great for testing with e.g.:

./api/examples/edit-message --message=348135 --content="test $(date +%s)" --site=http://localhost:9991 --subject="test"

The next commit will add a user interface for actually doing the editing.

(imported from commit bdd408cec2946f31c2292e44f724f96ed5938791)
This commit is contained in:
Tim Abbott 2013-05-14 15:18:11 -04:00 committed by Leo Franchi
parent c849ae3470
commit be7903443c
2 changed files with 53 additions and 0 deletions

View file

@ -272,6 +272,7 @@ def _mk_events(event_types=None):
return dict(event_types=event_types)
Client._register('send_message', url='messages', make_request=(lambda request: request))
Client._register('update_message', method='PATCH', url='messages', make_request=(lambda request: request))
Client._register('get_messages', method='GET', url='messages/latest', longpolling=True)
Client._register('get_events', url='events', method='GET', longpolling=True, make_request=(lambda **kwargs: kwargs))
Client._register('register', make_request=_mk_events)