From 656dbbdf4aea9e1b6086ed2de1a9bd75d66ae442 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 16 Aug 2019 13:31:53 -0400 Subject: [PATCH] Make room filter field consider room's last event --- src/python/matrix_client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index dda4aee9..704f8f55 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -4,6 +4,7 @@ import inspect import json import logging as log import platform +import re from contextlib import suppress from datetime import datetime from enum import Enum @@ -346,7 +347,13 @@ class MatrixClient(nio.AsyncClient): inviter_name = room.user_name(inviter) if inviter else "", inviter_avatar = room.avatar_url(inviter) if inviter else "", left = left, - filter_string = " ".join({name, room.topic or ""}).strip(), + filter_string = " ".join({ + name, + room.topic or "", + re.sub( + r"<.*?>", "", last_ev["inline_content"], + ) if last_ev else "", + }).strip(), last_event = last_ev, )