Skip to content

Commit

Permalink
re-add reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Airyzz committed Jun 1, 2024
1 parent ec646e5 commit 4b971fa
Showing 1 changed file with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,26 @@ extension BenchmarkTimeline on MatrixRoom {
var relatedEventId = '\$${seed + 5}';
bool canBeRelatedEvent = seed < 495;

// var json = {
// 'event_id': '\$$seed',
// 'sender': _userId,
// 'room_id': matrixRoom.id,
// 'origin_server_ts':
// DateTime.now().subtract(Duration(days: seed)).millisecondsSinceEpoch
// };

// if (r.nextDouble() < 0.2 && canBeRelatedEvent) {
// json['type'] = 'm.reaction';
// json['content'] = {
// 'm.relates_to': {
// 'event_id': relatedEventId,
// 'rel_type': 'm.annotation',
// 'key': r.nextBool() ? 'String Reaction' : "❤️"
// }
// };

// return matrix.Event.fromJson(json, matrixRoom);
// }
var json = {
'event_id': '\$$seed',
'sender': _userId,
'room_id': matrixRoom.id,
'origin_server_ts':
DateTime.now().subtract(Duration(days: seed)).millisecondsSinceEpoch
};

if (r.nextDouble() < 0.33 && canBeRelatedEvent) {
json['type'] = 'm.reaction';
json['content'] = {
'm.relates_to': {
'event_id': relatedEventId,
'rel_type': 'm.annotation',
'key': r.nextBool() ? 'String Reaction' : "❤️"
}
};

return matrix.Event.fromJson(json, matrixRoom);
}

var contentLength = r.nextInt(200) + 10;

Expand Down

0 comments on commit 4b971fa

Please sign in to comment.