diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-26 19:31:11 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-01-05 21:01:30 +0900 |
commit | 4ec3dd92d2cb5af4cf4893770e29db51d23e0e67 (patch) | |
tree | f61bf9d095a420d953ee6c43e4a8ecdb1a2a5039 /lib/events/stateevent.h | |
parent | 3ecf762f497a4d4b6ea7583689c0b9b284300201 (diff) | |
download | libquotient-4ec3dd92d2cb5af4cf4893770e29db51d23e0e67.tar.gz libquotient-4ec3dd92d2cb5af4cf4893770e29db51d23e0e67.zip |
Make content in events editable
Diffstat (limited to 'lib/events/stateevent.h')
-rw-r--r-- | lib/events/stateevent.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/events/stateevent.h b/lib/events/stateevent.h index d82de7e1..d488c0a0 100644 --- a/lib/events/stateevent.h +++ b/lib/events/stateevent.h @@ -88,6 +88,12 @@ namespace QMatrixClient { } const ContentT& content() const { return _content; } + template <typename VisitorT> + void editContent(VisitorT&& visitor) + { + visitor(_content); + editJson()[ContentKeyL] = _content.toJson(); + } [[deprecated("Use prevContent instead")]] const ContentT* prev_content() const { return prevContent(); } const ContentT* prevContent() const |