mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Fixed revdel issue for edit coming after revdeleted one which caused invalid SQL syntax
This commit is contained in:
parent
38e73052e6
commit
2a06074df5
15
src/wiki.py
15
src/wiki.py
|
@ -251,13 +251,14 @@ class Wiki:
|
||||||
messagequeue.add_message(QueueEntry(stacked_message, [stacked_message.webhook], self, method="PATCH"))
|
messagequeue.add_message(QueueEntry(stacked_message, [stacked_message.webhook], self, method="PATCH"))
|
||||||
if mode == "rev_id" and "content" in censored_properties: # Erase content field from messages coming AFTER revdel'd edit
|
if mode == "rev_id" and "content" in censored_properties: # Erase content field from messages coming AFTER revdel'd edit
|
||||||
middle_ids = (await self.find_middle_next(ids, page_id)).difference(ids)
|
middle_ids = (await self.find_middle_next(ids, page_id)).difference(ids)
|
||||||
async for stacked_message, webhook in self.message_history.fetch_stacked_from_db({"rev_id": middle_ids, "message_display": 3}):
|
if middle_ids: # Ignore if not found any IDs to censor
|
||||||
for message in [message for message in stacked_message.message_list if
|
async for stacked_message, webhook in self.message_history.fetch_stacked_from_db({"rev_id": middle_ids, "message_display": 3}):
|
||||||
message.metadata.matches({"rev_id": middle_ids})]:
|
for message in [message for message in stacked_message.message_list if
|
||||||
if "content" in censored_properties and "fields" in message.embed:
|
message.metadata.matches({"rev_id": middle_ids})]:
|
||||||
message.embed.pop("fields")
|
if "content" in censored_properties and "fields" in message.embed:
|
||||||
logger.debug(f"Rev-deleting content of message {stacked_message.discord_callback_message_id} due to being in list of middle ids {middle_ids}.")
|
message.embed.pop("fields")
|
||||||
messagequeue.add_message(QueueEntry(stacked_message, [stacked_message.webhook], self, method="PATCH"))
|
logger.debug(f"Rev-deleting content of message {stacked_message.discord_callback_message_id} due to being in list of middle ids {middle_ids}.")
|
||||||
|
messagequeue.add_message(QueueEntry(stacked_message, [stacked_message.webhook], self, method="PATCH"))
|
||||||
|
|
||||||
# async def downtime_controller(self, down, reason=None):
|
# async def downtime_controller(self, down, reason=None):
|
||||||
# if down:
|
# if down:
|
||||||
|
|
Loading…
Reference in a new issue