Reactions: Use the hack like on riot-android and riot-web if the server has not yet the aggregations API

Fix Steve's comment
This commit is contained in:
manuroe
2019-05-20 17:00:57 +02:00
parent 2824372877
commit 5af992a2a4
@@ -216,6 +216,11 @@ final class ReactionsMenuViewModel: ReactionsMenuViewModelType {
///
/// - Parameter reaction: the reaction
private func reactUsingHack(withReaction reaction: ReactionsMenuReaction) {
guard let room = self.session.room(withRoomId: self.roomId) else {
print("[ReactionsMenuViewModel] reactUsingHack: Error: Unknown room: \(self.roomId)")
return
}
print("[ReactionsMenuViewModel] reactUsingHack")
let reactionContent = [
@@ -226,8 +231,7 @@ final class ReactionsMenuViewModel: ReactionsMenuViewModelType {
]
var nilEvent: MXEvent?
let room = self.session.room(withRoomId: self.roomId)
room?.sendEvent(.reaction, content: reactionContent, localEcho: &nilEvent, completion: { [weak self] ( completion) in
room.sendEvent(.reaction, content: reactionContent, localEcho: &nilEvent, completion: { [weak self] ( completion) in
guard let sself = self else {
return
}