fix minor issue

master
Aevann 2024-08-07 17:57:32 +03:00
parent fd92301559
commit dc42566362
2 changed files with 10 additions and 7 deletions

View File

@ -72,6 +72,7 @@ def chat(v, chat_id):
if chat.id == 1:
if not v.allowed_in_chat:
abort(403, f"To prevent spam, you'll need {TRUESCORE_MINIMUM} truescore (this is {TRUESCORE_MINIMUM} votes, either up or down, on any threads or comments you've made) in order to access chat. Sorry! I love you 💖")
membership = True
else:
membership = g.db.query(ChatMembership).filter_by(user_id=v.id, chat_id=chat_id).one_or_none()
if v.admin_level < PERMS['VIEW_CHATS'] and not membership:
@ -108,9 +109,9 @@ def chat(v, chat_id):
orgy = get_running_orgy(v, chat_id)
if orgy:
orgies = g.db.query(Orgy).filter_by(chat_id=chat_id).order_by(Orgy.start_utc).all()
return render_template("orgy.html", v=v, messages=displayed_messages, chat=chat, sorted_memberships=sorted_memberships, muting_chat=muting_chat, orgy=orgy, orgies=orgies)
return render_template("orgy.html", v=v, messages=displayed_messages, chat=chat, sorted_memberships=sorted_memberships, muting_chat=muting_chat, orgy=orgy, orgies=orgies, membership=membership)
return render_template("chat.html", v=v, messages=displayed_messages, chat=chat, sorted_memberships=sorted_memberships, muting_chat=muting_chat)
return render_template("chat.html", v=v, messages=displayed_messages, chat=chat, sorted_memberships=sorted_memberships, muting_chat=muting_chat, membership=membership)
@app.post("/chat/<int:chat_id>/name")

View File

@ -393,13 +393,15 @@
<span id="typing-indicator"></span>
</div>
{{emoji_btn('input-text-chat')}}
{{gif_btn('input-text-chat')}}
{{file_btn('file', False, True)}}
{% if membership %}
{{emoji_btn('input-text-chat')}}
{{gif_btn('input-text-chat')}}
{{file_btn('file', False, True)}}
<textarea id="input-text-chat" minlength="1" maxlength="1000" {% if g.browser in ("iphone","mac") %}style="font-size:16px!important"{% endif %} class="file-ta form-control ml-2" placeholder="Message" autocomplete="off" autofocus rows="1"></textarea>
<textarea id="input-text-chat" minlength="1" maxlength="1000" {% if g.browser in ("iphone","mac") %}style="font-size:16px!important"{% endif %} class="file-ta form-control ml-2" placeholder="Message" autocomplete="off" autofocus rows="1"></textarea>
<i id="chatsend" data-nonce="{{g.nonce}}" data-onclick="send()" class="btn btn-secondary fas fa-reply ml-1 my-auto" style="transform:rotateY(180deg)"></i>
<i id="chatsend" data-nonce="{{g.nonce}}" data-onclick="send()" class="btn btn-secondary fas fa-reply ml-1 my-auto" style="transform:rotateY(180deg)"></i>
{% endif %}
</div>
<div id="ghostdiv-chat" class="ghostdiv" style="display: none"><span></span></div>
{% endmacro %}