-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from matrix-org/edits_start_reaction_end
Edits start - reaction end
- Loading branch information
Showing
16 changed files
with
1,440 additions
and
573 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
Copyright 2019 The Matrix.org Foundation C.I.C | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "MXStore.h" | ||
#import "MXAggregationsStore.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface MXAggregatedEditsUpdater : NSObject | ||
|
||
- (instancetype)initWithMyUser:(NSString*)userId | ||
aggregationStore:(id<MXAggregationsStore>)store | ||
matrixStore:(id<MXStore>)matrixStore; | ||
|
||
#pragma mark - Data access | ||
//- (nullable MXAggregatedReactions *)aggregatedReactionsOnEvent:(NSString*)eventId inRoom:(NSString*)roomId; | ||
//- (nullable MXReactionCount*)reactionCountForReaction:(NSString*)reaction onEvent:(NSString*)eventId; | ||
|
||
#pragma mark - Data update listener | ||
//- (id)listenToEditsUpdateInRoom:(NSString *)roomId block:(void (^)(NSDictionary<NSString *,MXReactionCountChange *> * _Nonnull))block; | ||
//- (void)removeListener:(id)listener; | ||
|
||
#pragma mark - Data update | ||
//- (void)handleOriginalAggregatedDataOfEvent:(MXEvent *)event replaces:(MXEventReplaceChunk*)replaces; | ||
- (void)handleReplace:(MXEvent *)event direction:(MXTimelineDirection)direction; | ||
- (void)handleRedaction:(MXEvent *)event; | ||
|
||
- (void)resetDataInRoom:(NSString *)roomId; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
Copyright 2019 The Matrix.org Foundation C.I.C | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import "MXAggregatedEditsUpdater.h" | ||
|
||
@interface MXAggregatedEditsUpdater () | ||
|
||
@property (nonatomic) NSString *myUserId; | ||
@property (nonatomic, weak) id<MXStore> matrixStore; | ||
@property (nonatomic, weak) id<MXAggregationsStore> store; | ||
//@property (nonatomic) NSMutableArray<MXReactionCountChangeListener*> *listeners; | ||
|
||
@end | ||
|
||
@implementation MXAggregatedEditsUpdater | ||
|
||
- (instancetype)initWithMyUser:(NSString*)userId | ||
aggregationStore:(id<MXAggregationsStore>)store | ||
matrixStore:(id<MXStore>)matrixStore | ||
{ | ||
self = [super init]; | ||
if (self) | ||
{ | ||
self.myUserId = userId; | ||
self.store = store; | ||
self.matrixStore = matrixStore; | ||
|
||
//self.listeners = [NSMutableArray array]; | ||
} | ||
return self; | ||
} | ||
|
||
|
||
#pragma mark - Data access | ||
|
||
//- (nullable MXAggregatedReactions *)aggregatedReactionsOnEvent:(NSString*)eventId inRoom:(NSString*)roomId; | ||
//- (nullable MXReactionCount*)reactionCountForReaction:(NSString*)reaction onEvent:(NSString*)eventId; | ||
|
||
|
||
#pragma mark - Data update listener | ||
|
||
//- (id)listenToEditsUpdateInRoom:(NSString *)roomId block:(void (^)(NSDictionary<NSString *,MXReactionCountChange *> * _Nonnull))block; | ||
//- (void)removeListener:(id)listener; | ||
|
||
|
||
#pragma mark - Data update | ||
|
||
//- (void)handleOriginalAggregatedDataOfEvent:(MXEvent *)event replaces:(MXEventReplaceChunk*)replaces; | ||
|
||
- (void)handleReplace:(MXEvent *)event direction:(MXTimelineDirection)direction | ||
{ | ||
|
||
} | ||
|
||
- (void)handleRedaction:(MXEvent *)event | ||
{ | ||
|
||
} | ||
|
||
- (void)resetDataInRoom:(NSString *)roomId | ||
{ | ||
|
||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
Copyright 2019 The Matrix.org Foundation C.I.C | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "MXAggregatedReactions.h" | ||
#import "MXEventAnnotationChunk.h" | ||
|
||
#import "MXStore.h" | ||
#import "MXAggregationsStore.h" | ||
#import "MXReactionCountChangeListener.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface MXAggregatedReactionsUpdater : NSObject | ||
|
||
- (instancetype)initWithMyUser:(NSString*)userId | ||
aggregationStore:(id<MXAggregationsStore>)store | ||
matrixStore:(id<MXStore>)matrixStore; | ||
|
||
#pragma mark - Data access | ||
- (nullable MXAggregatedReactions *)aggregatedReactionsOnEvent:(NSString*)eventId inRoom:(NSString*)roomId; | ||
- (nullable MXReactionCount*)reactionCountForReaction:(NSString*)reaction onEvent:(NSString*)eventId; | ||
|
||
#pragma mark - Data update listener | ||
- (id)listenToReactionCountUpdateInRoom:(NSString *)roomId block:(void (^)(NSDictionary<NSString *,MXReactionCountChange *> * _Nonnull))block; | ||
- (void)removeListener:(id)listener; | ||
|
||
#pragma mark - Data update | ||
- (void)handleOriginalAggregatedDataOfEvent:(MXEvent *)event annotations:(MXEventAnnotationChunk*)annotations; | ||
- (void)handleReaction:(MXEvent *)event direction:(MXTimelineDirection)direction; | ||
- (void)handleRedaction:(MXEvent *)event; | ||
|
||
- (void)resetDataInRoom:(NSString *)roomId; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.