Skip to content

Commit 394462f

Browse files
authored
Merge pull request #21 from erdnaxeli/fixHandleImageTagCheck
Fix handle image tag check
2 parents 9065da0 + 1b95119 commit 394462f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-puppet-bridge",
3-
"version": "1.15.1",
3+
"version": "1.15.2",
44
"description": "facilitates writing a certain kind of matrix bridge",
55
"main": "index.js",
66
"scripts": {

Diff for: src/base.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -631,14 +631,17 @@ class Base {
631631

632632
return this.getOrCreateMatrixRoomFromThirdPartyRoomId(roomId).then((matrixRoomId) => {
633633
return this.getUserClient(matrixRoomId, senderId, senderName, avatarUrl).then((client) => {
634-
635634
if (senderId === undefined) {
636635
info("this message was sent by me, but did it come from a matrix client or a 3rd party client?");
637636
info("if it came from a 3rd party client, we want to repeat it as a 'notice' type message");
638637
info("if it came from a matrix client, then it's already in the client, sending again would dupe");
639638
info("we use a tag on the end of messages to determine if it came from matrix");
640639

641-
if (this.isTaggedMatrixMessage(text) || isFilenameTagged(path)) {
640+
if (typeof text === 'undefined') {
641+
info("we can't know if this message is from matrix or not, so just ignore it");
642+
return;
643+
}
644+
else if (this.isTaggedMatrixMessage(text) || isFilenameTagged(path)) {
642645
info('it is from matrix, so just ignore it.');
643646
return;
644647
} else {

0 commit comments

Comments
 (0)