generated from exteraGramPlugins/pluginBase
Message Logger: hidden messages on the server, removed chats, old chat photos
Publish plugin / publish (push) Successful in 6s
Publish plugin / publish (push) Successful in 6s
- Hidden deleted messages are marked on the server (local marks migrated); "Reveal hidden messages" in the chat menu, Unhide in the message menu and the selection bar. - Chats an account lost are reported, listed among its chats again and opened read-only with their logged messages, all deleted. - Logged chat photos: a removed chat's avatar, and in a chat's photos the ones it no longer has, translucent with a trash icon in the viewer's previews. - Fix: the deleted-post comments thread is answered locally again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0176f7099d
commit
362b358d8d
15 files changed
+1821
-125
No files matched your search
+38
-5
@@ -33,9 +33,9 @@ read_only = set()
|
||||
_lock = threading.Lock()
|
||||
|
||||
|
||||
def make_read_only(chat):
|
||||
"""Swaps a comment screen's input bar for a read-only notice (the app's
|
||||
own bottom overlay, as in chats one can't write to). UI thread."""
|
||||
def make_read_only(chat, notice="Viewing deleted comments"):
|
||||
"""Swaps a screen's input bar for a read-only notice (the app's own
|
||||
bottom overlay, as in chats one can't write to). UI thread."""
|
||||
from android.view import View
|
||||
|
||||
from jutil import field
|
||||
@@ -47,7 +47,12 @@ def make_read_only(chat):
|
||||
text = field(chat, "bottomOverlayText")
|
||||
if overlay is None or text is None:
|
||||
return
|
||||
for name in ("bottomOverlayChatText", "bottomOverlayStartButton", "bottomOverlayProgress"):
|
||||
for name in (
|
||||
"bottomOverlayChat", # a channel's bar (search, mute/join)
|
||||
"bottomOverlayChatText",
|
||||
"bottomOverlayStartButton",
|
||||
"bottomOverlayProgress",
|
||||
):
|
||||
other = field(chat, name)
|
||||
if other is not None:
|
||||
other.setVisibility(View.GONE)
|
||||
@@ -56,12 +61,40 @@ def make_read_only(chat):
|
||||
animation = field(chat, "bottomOverlayAnimation")
|
||||
if animation is not None:
|
||||
animation.cancel()
|
||||
text.setText("Viewing deleted comments")
|
||||
text.setText(notice)
|
||||
text.setVisibility(View.VISIBLE)
|
||||
overlay.setAlpha(1.0)
|
||||
overlay.setVisibility(View.VISIBLE)
|
||||
|
||||
|
||||
def answer(account, request):
|
||||
"""The response for a getReplies of a thread opened here, else None."""
|
||||
with _lock:
|
||||
thread = _threads.get(int(request.msg_id))
|
||||
if thread is None or thread[0] != int(account):
|
||||
return None
|
||||
_account, _discussion, messages, users, chats = thread
|
||||
from java.util import ArrayList
|
||||
from org.telegram.tgnet import TLRPC
|
||||
|
||||
offset_id = int(request.offset_id or 0)
|
||||
add_offset = int(request.add_offset or 0)
|
||||
picked = [
|
||||
m for m in messages if not offset_id or add_offset < 0 or int(m.id) < offset_id
|
||||
]
|
||||
response = TLRPC.TL_messages_messages()
|
||||
response.messages = ArrayList()
|
||||
for message in sorted(picked, key=lambda m: -int(m.id)):
|
||||
response.messages.add(message)
|
||||
response.users = ArrayList()
|
||||
for user in users:
|
||||
response.users.add(user)
|
||||
response.chats = ArrayList()
|
||||
for chat in chats:
|
||||
response.chats.add(chat)
|
||||
return response
|
||||
|
||||
|
||||
def _peer(controller, marked):
|
||||
"""TLRPC peer of a Telethon sender id."""
|
||||
from hooks.chat import _android_peer_id
|
||||
|
||||
Reference in new issue
Block a user