Fix "tarfindId" sed rename mistakes

This commit is contained in:
miruka 2019-07-08 13:24:05 -04:00
parent 4472d44320
commit 861347ce64
3 changed files with 9 additions and 4 deletions

View File

@ -258,6 +258,9 @@ class MatrixClient(nio.AsyncClient):
# pylint: disable=unused-argument
async def onRoomMessageText(self, room, ev, from_past=False) -> None:
if ev.event_id == "$1562605869886420ieZBa:matrix.org":
print("GOT DECRYPTED")
co = HTML_FILTER.filter(
ev.formatted_body
if ev.format == "org.matrix.custom.html" else html.escape(ev.body)
@ -402,6 +405,8 @@ class MatrixClient(nio.AsyncClient):
async def onOlmEvent(self, room, ev, from_past=False) -> None:
if ev.event_id == "$1562605869886420ieZBa:matrix.org":
print(json.dumps( ev.__dict__ , indent=4))
co = f"%S hasn't sent your device the keys to decrypt this message."
TimelineEventReceived.from_nio(room, ev, content=co)

View File

@ -109,7 +109,7 @@ function onTimelineEventReceived(
"isLocalEcho": is_local_echo,
"showNameLine": show_name_line,
"translatable": translatable,
"tarfindId": target_user_id,
"targetUserId": target_user_id,
}
if (is_local_echo) {

View File

@ -77,9 +77,9 @@ function translatedEventContent(ev) {
var text = ev.content.replace("%S", coloredNameHtml(name, ev.senderId))
// %T → target (event state_key) display name
if (ev.tarfindId) {
var tname = users.find(ev.tarfindId).displayName
text = text.replace("%T", coloredNameHtml(tname, ev.tarfindId))
if (ev.targetUserId) {
var tname = users.find(ev.targetUserId).displayName
text = text.replace("%T", coloredNameHtml(tname, ev.targetUserId))
}
text = qsTr(text)