allow chat owner to leave it https://rdrama.net/h/meta/post/270946/how-can-i-make-it-stop/6440911#context
parent
20c3cad072
commit
eeb3c10172
|
@ -142,9 +142,6 @@ def leave_chat(v, chat_id):
|
|||
if not chat:
|
||||
abort(404, "Chat not found!")
|
||||
|
||||
if v.id == chat.owner_id:
|
||||
abort(403, "The chat owner can't leave it!")
|
||||
|
||||
membership = g.db.query(ChatMembership).filter_by(user_id=v.id, chat_id=chat_id).one_or_none()
|
||||
if not membership:
|
||||
abort(400, "You're not a member of this chat!")
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
</form>
|
||||
|
||||
<a href="/chat/{{chat.id}}/orgies" class="orgy-control fas fa-tv text-muted ml-2"></a>
|
||||
{% else %}
|
||||
<button id="leave-private-chat" type="submit" class="btn btn-danger ml-1 ml-md-3 px-2 text-small-sm" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-areyousure="postToastReload(this, '/chat/{{chat.id}}/leave')">Leave</button>
|
||||
{% endif %}
|
||||
|
||||
<button id="leave-private-chat" type="submit" class="btn btn-danger ml-1 ml-md-3 px-2 text-small-sm" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-areyousure="postToastReload(this, '/chat/{{chat.id}}/leave')">Leave</button>
|
||||
{% endif %}
|
||||
|
||||
<div id="chat-group-template" class="d-none">
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
|
||||
{% if v.id == chat.owner_id %}
|
||||
<a href="/chat/{{chat.id}}/orgies" class="orgy-control fas fa-tv text-muted ml-2"></a>
|
||||
{% else %}
|
||||
<button id="leave-private-chat" type="submit" class="btn btn-danger ml-1 ml-md-3 px-2 text-small-sm" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-areyousure="postToastReload(this, '/chat/{{chat.id}}/leave')">Leave</button>
|
||||
{% endif %}
|
||||
|
||||
<button id="leave-private-chat" type="submit" class="btn btn-danger ml-1 ml-md-3 px-2 text-small-sm" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-areyousure="postToastReload(this, '/chat/{{chat.id}}/leave')">Leave</button>
|
||||
|
||||
<div>
|
||||
<p id="orgy-file-container" class="resizable">
|
||||
{% if orgy.type == 'youtube' %}
|
||||
|
|
Loading…
Reference in New Issue