aboutsummaryrefslogtreecommitdiff
path: root/lib/events/stateevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/stateevent.h')
-rw-r--r--lib/events/stateevent.h6
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