add: chat pins

This commit is contained in:
trisua 2025-09-03 17:12:26 -04:00
parent 9546c580e7
commit 82eafdadb3
21 changed files with 330 additions and 56 deletions

View file

@ -326,3 +326,27 @@ function create_direct_chat_with_user(id) {
}
});
}
function pin_message(e, id) {
fetch(`/api/v1/chats/${STATE.chat_id}/pins/${id}`, {
method: "POST",
})
.then((res) => res.json())
.then((res) => {
show_message(res.message, res.ok);
if (res.ok) {
e.target.remove();
}
});
}
function unpin_message(id) {
fetch(`/api/v1/chats/${STATE.chat_id}/pins/${id}`, {
method: "DELETE",
})
.then((res) => res.json())
.then((res) => {
show_message(res.message, res.ok);
});
}

View file

@ -116,6 +116,10 @@ article {
height: 100%;
}
.tabs {
overflow: auto;
}
.fadein {
animation: fadein ease-in-out 1 0.5s forwards running;
}
@ -801,6 +805,7 @@ menu.col {
background: var(--color-surface);
color: var(--color-text);
border-radius: var(--radius);
min-height: 36px;
}
.message.mine .body {
@ -812,3 +817,8 @@ menu.col {
.message:not(.mine) .body {
border-bottom-left-radius: 0;
}
.message:hover .dropdown.hidden,
.message:focus .dropdown.hidden {
display: flex !important;
}