"""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