aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-02 13:19:41 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-07-04 09:07:32 +0900
commitbd853f392aaf5b05e0a8023da85a38e91d90a6e0 (patch)
tree1a89457af426e771531a9002ccf61603f0b87dc2 /lib
parentf1ffe1e7a3e81c07a07a8416ce307e4413ec8fbc (diff)
downloadlibquotient-bd853f392aaf5b05e0a8023da85a38e91d90a6e0.tar.gz
libquotient-bd853f392aaf5b05e0a8023da85a38e91d90a6e0.zip
TimelineItem::operator*()
Diffstat (limited to 'lib')
-rw-r--r--lib/room.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/room.h b/lib/room.h
index 21016c38..975e6caf 100644
--- a/lib/room.h
+++ b/lib/room.h
@@ -48,12 +48,16 @@ namespace QMatrixClient
using index_t = int;
TimelineItem(RoomEventPtr&& e, index_t number)
- : evt(std::move(e)), idx(number) { }
+ : evt(std::move(e)), idx(number)
+ {
+ Q_ASSERT(evt);
+ }
const RoomEvent* event() const { return rawPtr(evt); }
template <typename EventT>
const EventT* viewAs() const { return weakPtrCast<const EventT>(evt); }
const RoomEventPtr& operator->() const { return evt; }
+ const RoomEvent& operator*() const { return *evt; }
index_t index() const { return idx; }
// Used for event redaction