mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 10:38:41 +00:00
25 lines
612 B
Dart
25 lines
612 B
Dart
import 'package:twonly/globals.dart';
|
|
import 'package:twonly/src/model/protobuf/client/generated/messages.pb.dart';
|
|
|
|
Future<void> handleReaction(
|
|
int fromUserId,
|
|
String groupId,
|
|
EncryptedContent_Reaction reaction,
|
|
) async {
|
|
if (reaction.hasRemove()) {
|
|
if (reaction.remove) {
|
|
await twonlyDB.reactionsDao
|
|
.updateReaction(fromUserId, reaction.targetMessageId, groupId, null);
|
|
}
|
|
return;
|
|
}
|
|
if (reaction.hasEmoji()) {
|
|
await twonlyDB.reactionsDao.updateReaction(
|
|
fromUserId,
|
|
reaction.targetMessageId,
|
|
groupId,
|
|
reaction.emoji,
|
|
);
|
|
return;
|
|
}
|
|
}
|