This commit is contained in:
Troplo 2022-08-07 23:17:49 +10:00
parent 5a7902ff47
commit 3a6d7942a6
7 changed files with 60 additions and 32 deletions

View file

@ -7,6 +7,8 @@ let os = require("os")
app.set("trust proxy", true)
app.locals.config = require("./config/config.json")
const socket = require("./lib/socket")
const { User } = require("./models")
const { Op } = require("sequelize")
const server = require("http").createServer(app)
app.use(bodyParser.json({ limit: "15mb" }))
@ -47,6 +49,18 @@ console.log(os.hostname())
app.use(require("./lib/errorHandler"))
server.listen(23998, () => {
User.update(
{
status: "offline"
},
{
where: {
status: {
[Op.ne]: "offline"
}
}
}
)
console.log("Initialized")
console.log("Listening on port 0.0.0.0:" + 23998)

View file

@ -1,5 +1,6 @@
const auth = require("../lib/authorize_socket.js")
const { User, Friend, Session, Theme } = require("../models")
const { Op } = require("sequelize")
module.exports = {
init(app, server) {
const io = require("socket.io")(server, {

View file

@ -5,7 +5,7 @@
publish: ["github"]
},
linux: {
target: ["AppImage", "deb", "tar.gz", "snap", "pacman"],
target: ["AppImage", "deb", "tar.gz", "snap"],
publish: ["github"],
category: "Network",
synopsis: "Instant Messaging",

View file

@ -1,6 +1,6 @@
{
"name": "colubrina",
"version": "1.0.20",
"version": "1.0.21",
"description": "Simple instant communication.",
"private": true,
"author": "Troplo <troplo@troplo.com>",

View file

@ -1,14 +1,19 @@
>>>.max-v-list-height {
max-height: 10px;
overflow-y: auto;
}
.mentioned-message {
box-shadow: -2px 0 0 0 var(--v-primary-base);
}
.offset-message {
padding-left: 53px;
margin-left: 53px;
}
.message-action-card {
position: absolute;
top: 0;
right: 0;
margin-top: 5px;
margin-top: -15px;
margin-right: 5px;
}
/* large codeblock */

View file

@ -36,12 +36,14 @@
{{ message.reply.content.substring(0, 100) }}
</v-toolbar>
<v-list-item
class="max-v-list-height"
:key="message.keyId"
:class="{
'message-hover': hover,
'pa-0': $vuetify.breakpoint.mobile,
'mentioned-message': mentioned
}"
:dense="lastMessage"
:id="'message-' + index"
@contextmenu="show($event, 'message', message)"
:style="lastMessage ? 'margin-bottom: -5px; margin-top: -5px;' : ''"
@ -400,7 +402,8 @@
></CommsInput>
</v-list-item-content>
<v-card
elevation="3"
elevation="8"
color="card"
class="message-action-card"
v-if="!$vuetify.breakpoint.mobile && hover"
>

View file

@ -51,6 +51,9 @@
class="rounded-l"
>
<v-list class="rounded-l" v-if="context.message.item">
<v-list-item @click="copy(context.message.item.content)">
<v-list-item-title>Copy Message Content</v-list-item-title>
</v-list-item>
<v-list-item @click="replying = context.message.item">
<v-list-item-title>Reply to Message</v-list-item-title>
</v-list-item>
@ -126,6 +129,7 @@
v-if="!loading && $vuetify.breakpoint.mobile"
app
right
style="z-index: 100"
>
<v-list two-line color="card">
<v-list-item-group class="rounded-xl">
@ -275,33 +279,31 @@
</template>
<v-tooltip top>
<template v-slot:activator="{ on }">
<span>
<v-btn
icon
small
fab
width="20"
height="20"
class="ml-2 mt-2"
style="float: right"
@click="openUserPanel($store.state.user)"
>
<v-avatar size="20" v-on="on" color="primary">
<img
v-if="$store.state.user.avatar"
:src="
$store.state.baseURL +
'/usercontent/' +
$store.state.user.avatar
"
alt="avatar"
/>
<span v-else>{{
$store.state.user.username[0].toUpperCase()
}}</span>
</v-avatar>
</v-btn>
</span>
<v-btn
icon
small
fab
width="20"
height="20"
class="ml-2 mt-2"
style="float: right"
@click="openUserPanel($store.state.user)"
>
<v-avatar size="20" v-on="on" color="primary">
<img
v-if="$store.state.user.avatar"
:src="
$store.state.baseURL +
'/usercontent/' +
$store.state.user.avatar
"
alt="avatar"
/>
<span v-else>{{
$store.state.user.username[0].toUpperCase()
}}</span>
</v-avatar>
</v-btn>
</template>
<span>
{{ $store.state.user.username }} has read up to this point.
@ -723,6 +725,9 @@ export default {
}
},
methods: {
copy(content) {
navigator.clipboard.writeText(content)
},
removePin(id) {
this.axios
.post(`/api/v1/communications/${this.chat.id}/pins`, {