From 75236cacbe28871ef58764306be2b716a7f02d1d Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 6 Apr 2024 08:27:43 +0200 Subject: [PATCH] rename private_chats to chats --- files/classes/__init__.py | 2 +- files/classes/{private_chats.py => chats.py} | 0 files/classes/user.py | 2 +- files/helpers/stats.py | 2 +- files/routes/__init__.py | 2 +- files/routes/chat.py | 2 +- files/routes/{private_chats.py => chats.py} | 6 +++--- files/routes/notifications.py | 2 +- files/templates/{private_chat.html => chat.html} | 0 9 files changed, 9 insertions(+), 9 deletions(-) rename files/classes/{private_chats.py => chats.py} (100%) rename files/routes/{private_chats.py => chats.py} (95%) rename files/templates/{private_chat.html => chat.html} (100%) diff --git a/files/classes/__init__.py b/files/classes/__init__.py index 62e6c0215..dd589d737 100644 --- a/files/classes/__init__.py +++ b/files/classes/__init__.py @@ -40,4 +40,4 @@ if FEATURES['IP_LOGGING']: from .ip_logs import * from .edit_logs import * -from .private_chats import * +from .chats import * diff --git a/files/classes/private_chats.py b/files/classes/chats.py similarity index 100% rename from files/classes/private_chats.py rename to files/classes/chats.py diff --git a/files/classes/user.py b/files/classes/user.py index 08bdb0d31..af37aad98 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -14,7 +14,7 @@ from files.classes import Base from files.classes.casino_game import CasinoGame from files.classes.group import * from files.classes.hole import Hole -from files.classes.private_chats import ChatMembership +from files.classes.chats import ChatMembership from files.classes.currency_logs import CurrencyLog from files.helpers.config.const import * from files.helpers.config.modaction_types import * diff --git a/files/helpers/stats.py b/files/helpers/stats.py index 299c942f6..f952846b1 100644 --- a/files/helpers/stats.py +++ b/files/helpers/stats.py @@ -8,7 +8,7 @@ from files.classes.user import User from files.classes.post import Post from files.classes.comment import Comment from files.classes.votes import Vote, CommentVote -from files.classes.private_chats import ChatMessage +from files.classes.chats import ChatMessage from files.classes.emoji import * from files.classes.award import AwardRelationship from files.helpers.config.const import * diff --git a/files/routes/__init__.py b/files/routes/__init__.py index bc74aa7ce..a9d71c31e 100644 --- a/files/routes/__init__.py +++ b/files/routes/__init__.py @@ -53,7 +53,7 @@ from .special import * from .push_notifs import * if FEATURES['PING_GROUPS']: from .groups import * -from .private_chats import * +from .chats import * if IS_LOCALHOST: from sys import argv diff --git a/files/routes/chat.py b/files/routes/chat.py index d54614c04..8854d5198 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -16,7 +16,7 @@ from files.helpers.alerts import push_notif from files.helpers.can_see import * from files.routes.wrappers import * from files.classes.orgy import * -from files.classes.private_chats import * +from files.classes.chats import * from files.__main__ import app, cache, limiter diff --git a/files/routes/private_chats.py b/files/routes/chats.py similarity index 95% rename from files/routes/private_chats.py rename to files/routes/chats.py index e7702a24e..b1ec05d74 100644 --- a/files/routes/private_chats.py +++ b/files/routes/chats.py @@ -1,5 +1,5 @@ -from files.classes.private_chats import * +from files.classes.chats import * from files.routes.wrappers import * from files.helpers.config.const import * from files.helpers.get import * @@ -58,7 +58,7 @@ def chat_user(v, username): @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400) @limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID) @auth_required -def private_chat(v, chat_id): +def chat(v, chat_id): chat = g.db.get(Chat, chat_id) if not chat: abort(404, "Chat not found!") @@ -84,7 +84,7 @@ def private_chat(v, chat_id): query = g.db.query(ChatMembership).filter_by(chat_id=chat.id) sorted_memberships = [query.filter_by(user_id=chat.owner_id).one()] + query.filter(ChatMembership.user_id != chat.owner_id).join(ChatMembership.user).order_by(func.lower(User.username)).all() - return render_template("private_chat.html", v=v, messages=displayed_messages, chat=chat, sorted_memberships=sorted_memberships) + return render_template("chat.html", v=v, messages=displayed_messages, chat=chat, sorted_memberships=sorted_memberships) @app.post("/chat//name") diff --git a/files/routes/notifications.py b/files/routes/notifications.py index aa3b01420..60dd18626 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import load_only from files.classes.mod_logs import ModAction from files.classes.hole_logs import HoleAction -from files.classes.private_chats import * +from files.classes.chats import * from files.helpers.config.const import * from files.helpers.config.modaction_types import * from files.helpers.get import * diff --git a/files/templates/private_chat.html b/files/templates/chat.html similarity index 100% rename from files/templates/private_chat.html rename to files/templates/chat.html