Implement Rich Quoting/Replies

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2017-12-10 12:50:41 +00:00
parent 4f58b92a14
commit 0f85391587
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E
8 changed files with 405 additions and 98 deletions

View file

@ -1,5 +1,6 @@
/*
Copyright 2017 Vector Creations Ltd
Copyright 2017 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -41,6 +42,8 @@ const INITIAL_STATE = {
roomLoadError: null,
forwardingEvent: null,
quotingEvent: null,
};
/**
@ -108,6 +111,10 @@ class RoomViewStore extends Store {
forwardingEvent: payload.event,
});
break;
case 'quote_event':
this._setState({
quotingEvent: payload.event,
});
}
}
@ -286,6 +293,11 @@ class RoomViewStore extends Store {
return this._state.forwardingEvent;
}
// The mxEvent if one is currently being replied to/quoted
getQuotingEvent() {
return this._state.quotingEvent;
}
shouldPeek() {
return this._state.shouldPeek;
}