Skip to content

Commit 7e58c27

Browse files
authored
Many quote related fixes
1 parent c6aee62 commit 7e58c27

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/base.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ class Base {
10041004
quotedEventId,
10051005
quotedUserId,
10061006
quotedText,
1007+
myUserId,
10071008
html
10081009
} = thirdPartyRoomMessageData;
10091010

@@ -1017,15 +1018,21 @@ class Base {
10171018
//TODO: do this the correct way
10181019
if (quotedEventId != null && quotedUserId != null && quotedText != null && this.bridge.getEventStore()) {
10191020
const quotedUserIntent = await this.getIntentFromThirdPartySenderId(quotedUserId);
1020-
const quotedUser = quotedUserIntent.client.credentials.userId;
1021+
let quotedUser = quotedUserIntent.client.credentials.userId;
1022+
let quotedEventEntry = await this.bridge.getEventStore().getEntryByRemoteId(quotedEventId, quotedUserId);
1023+
if (myUserId == quotedUserId) {
1024+
quotedUser = this.puppet.getClient().credentials.userId;
1025+
}
10211026
//Get event and roomId from the eventstore to look for the quote
1022-
const quotedEventEntry = await this.bridge.getEventStore().getEntryByRemoteId(quotedEventId, quotedUserId);
10231027
if (quotedEventEntry != null && quotedUser != null) {
10241028
const quoteMatrixRoomId = quotedEventEntry.getMatrixRoomId();
10251029
const quoteMatrixEventId = quotedEventEntry.getMatrixEventId();
10261030
html = this.formatTextToQuote(quoteMatrixRoomId, quoteMatrixEventId, quotedUser, quotedText, text);
10271031
text = "> <" + quotedUser + "> " + quotedText + "\\n \\n" +text;
10281032
}
1033+
else {
1034+
info("Did not find event for", quotedEventId, quotedUserId);
1035+
}
10291036
}
10301037

10311038
let tag = autoTagger(senderId, this);

0 commit comments

Comments
 (0)