generated from exteraGramPlugins/pluginBase
Publish plugin / publish (push) Successful in 4s
Keeps deleted messages (75% opacity, red icon-pack trash icon), restores logged messages deleted while away, reports deletions, and shows edit history as a mock chat (Edit history in the message menu, Open topic). Message links and history open as any signed-in account with access. Per-master API tokens; chat state synced per checked range with an hour's validity, cached in SQLite with a configurable lifetime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
"""Setting keys and defaults."""
|
|
|
|
SERVER_URL = "server_url"
|
|
API_TOKEN = "api_token"
|
|
KEEP_DELETED = "keep_deleted"
|
|
RESTORE_MISSING = "restore_missing"
|
|
REPORT_DELETIONS = "report_deletions"
|
|
DELETED_ALPHA = "deleted_alpha"
|
|
CACHE_DAYS = "cache_days"
|
|
|
|
DEFAULTS = {
|
|
SERVER_URL: "",
|
|
API_TOKEN: "",
|
|
KEEP_DELETED: True,
|
|
RESTORE_MISSING: True,
|
|
REPORT_DELETIONS: True,
|
|
DELETED_ALPHA: 0, # index into ALPHA_CHOICES
|
|
CACHE_DAYS: 2, # index into CACHE_DAYS_CHOICES
|
|
}
|
|
|
|
# Opacity of deleted messages: well visible, marked by the trash icon.
|
|
ALPHA_CHOICES = [("75%", 0.75), ("90%", 0.9), ("50%", 0.5)]
|
|
|
|
# A chat's checked range of message ids stays valid this long: within it the
|
|
# server is asked again only after an edit/delete event in the chat.
|
|
COVERAGE_SECONDS = 3600
|
|
# Cached server answers older than this are removed (checked once a day).
|
|
CACHE_DAYS_CHOICES = [
|
|
("1 day", 1),
|
|
("7 days", 7),
|
|
("30 days", 30),
|
|
("90 days", 90),
|
|
("365 days", 365),
|
|
("Never", None),
|
|
]
|
|
HTTP_TIMEOUT_SECONDS = 15
|