Skip to content

Commit c1e3a76

Browse files
authored
Catch reaction errors
1 parent cb6bada commit c1e3a76

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/base.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,13 +1080,18 @@ class Base {
10801080
let tag = autoTagger(senderId, this);
10811081

10821082
if (reaction) {
1083-
return await client.sendEvent(reaction.roomId, "m.reaction", {
1084-
"m.relates_to": {
1085-
event_id: reaction.eventId,
1086-
key: reaction.emoji,
1087-
rel_type: "m.annotation",
1088-
}
1089-
});
1083+
try {
1084+
return await client.sendEvent(reaction.roomId, "m.reaction", {
1085+
"m.relates_to": {
1086+
event_id: reaction.eventId,
1087+
key: reaction.emoji,
1088+
rel_type: "m.annotation",
1089+
}
1090+
});
1091+
}
1092+
catch (err) {
1093+
//We catch all errors as reactions are not important
1094+
}
10901095
}
10911096
if (html) {
10921097
return await client.sendMessage(matrixRoomId, {
@@ -1200,7 +1205,7 @@ class Base {
12001205
}
12011206
if (msgtype === 'm.video') {
12021207
logger.info("video file from riot");
1203-
1208+
12041209
let url = this.puppet.getClient().mxcUrlToHttp(data.content.url);
12051210
return await this.sendVideoAsPuppetToThirdPartyRoomWithId(thirdPartyRoomId, {
12061211
url, text: msg,

0 commit comments

Comments
 (0)