generated from exteraGramPlugins/pluginBase
Message Logger: keep own deletions, remove from view, reset marks
Publish plugin / publish (push) Successful in 4s
Publish plugin / publish (push) Successful in 4s
- Delete dialog: "Keep message for myself" checkbox keeps your deletion on this device (marked deleted); unticked, the message is hidden and never restored. Already deleted messages get a plain "Remove from view" dialog (fixes the chat staying dimmed/touch-blocked after it). - "Reset deleted/edited marks" in the chat menu (Plugins) and, for all chats, in the plugin settings. - Fix restored text-only messages showing as empty bubbles (rich text wrappers like links lost their text); missing settings icons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bbe4a557a8
commit
0176f7099d
9 files changed
+586
-12
No files matched your search
@@ -311,9 +311,39 @@ def main(argv=None) -> int:
|
||||
f"removed={removed} left={left}",
|
||||
)
|
||||
check("age purge runs once a day", store.purge_old(1) == 0)
|
||||
store.put_server_states(0, -7, [{"message_id": 1, "edit_count": 1}])
|
||||
store.put_server_states(0, -8, [{"message_id": 1, "edit_count": 1}])
|
||||
store.mark_deleted(0, -7, [2])
|
||||
store.hide(0, -7, [3])
|
||||
check(
|
||||
"reset forgets one chat's marks, keeps others and hidden ones",
|
||||
store.reset(0, -7) == 2
|
||||
and store.get(0, -7, 1) is None
|
||||
and store.get(0, -8, 1) is not None
|
||||
and store.is_hidden(0, -7, 3),
|
||||
)
|
||||
for name in ("cached_deleted", "coverage", "set_coverage", "expire_coverage", "replace_window"):
|
||||
check(f"store.{name} exists", callable(getattr(store, name, None)))
|
||||
|
||||
class JList(list):
|
||||
def size(self):
|
||||
return len(self)
|
||||
|
||||
def get(self, index):
|
||||
return self[index]
|
||||
|
||||
class Node:
|
||||
def __init__(self, text=None, texts=()):
|
||||
self.text, self.texts = text, JList(texts)
|
||||
|
||||
url = Node(Node("https://t.me/c/1/2")) # textUrl: empty `texts`
|
||||
concat = Node(None, [Node("a "), Node(Node("b"))])
|
||||
check(
|
||||
"rich text: wrappers and concatenations",
|
||||
chat._rich_text(url) == "https://t.me/c/1/2" and chat._rich_text(concat) == "a b",
|
||||
repr((chat._rich_text(url), chat._rich_text(concat))),
|
||||
)
|
||||
|
||||
api = load("api")
|
||||
client = api.Api(BasePlugin())
|
||||
check("API unconfigured without URL and token", not client.configured)
|
||||
|
||||
Reference in new issue
Block a user