Merge branch 'develop' into vue3
This commit is contained in:
commit
e184ca56c3
|
@ -10,3 +10,4 @@ docker-compose.yml
|
||||||
elasticsearch/
|
elasticsearch/
|
||||||
node_modules/
|
node_modules/
|
||||||
redis/
|
redis/
|
||||||
|
files/
|
||||||
|
|
|
@ -13,6 +13,8 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- internal_network
|
- internal_network
|
||||||
- external_network
|
- external_network
|
||||||
|
volumes:
|
||||||
|
- ./files:/misskey/files
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
@ -4,3 +4,30 @@ Docs for users are located in `src/docs`.
|
||||||
|
|
||||||
これらのドキュメントはMisskeyの開発者またはMisskeyインスタンス運営者向けです。
|
これらのドキュメントはMisskeyの開発者またはMisskeyインスタンス運営者向けです。
|
||||||
利用者向けのドキュメントは`src/docs`にあります。
|
利用者向けのドキュメントは`src/docs`にあります。
|
||||||
|
|
||||||
|
这些文档是为 Misskey 的贡献者,或是 Misskey 实例的管理者准备的。
|
||||||
|
为用户准备的文档放置在 `src/docs` 文件夹中。
|
||||||
|
|
||||||
|
## 日本語版
|
||||||
|
|
||||||
|
- [Misskey構築の手引き](./setup.ja.md)
|
||||||
|
- [運営ガイド](./manage.ja.md)
|
||||||
|
- [Dockerを使ったMisskey構築方法](./docker.ja.md)
|
||||||
|
|
||||||
|
## English Version
|
||||||
|
|
||||||
|
- [Misskey Setup and Installation Guide](./setup.en.md)
|
||||||
|
- [Management guide](./manage.en.md)
|
||||||
|
- [Docker Guide](./docker.en.md)
|
||||||
|
|
||||||
|
## Française Version
|
||||||
|
|
||||||
|
- [Guide d'installation et de configuration de Misskey](./setup.fr.md)
|
||||||
|
- [Guide d'administration](./manage.fr.md)
|
||||||
|
- [Guide Docker](./docker.fr.md)
|
||||||
|
|
||||||
|
## 简体中文版
|
||||||
|
|
||||||
|
- [Misskey 设置和安装指南](./setup.zh.md)
|
||||||
|
- [运营指南](./manage.zh.md)
|
||||||
|
- [Docker 部署指南](./docker.zh.md)
|
||||||
|
|
|
@ -3,7 +3,8 @@ Docker Guide
|
||||||
|
|
||||||
This guide describes how to install and setup Misskey with Docker.
|
This guide describes how to install and setup Misskey with Docker.
|
||||||
|
|
||||||
[Japanese version also available - 日本語版もあります](./docker.ja.md)
|
- [Japanese version also available - 日本語版もあります](./docker.ja.md)
|
||||||
|
- [Simplified Chinese version also available - 简体中文版同样可用](./docker.zh.md)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@ Guide Docker
|
||||||
|
|
||||||
Ce guide explique comment installer et configurer Misskey avec Docker.
|
Ce guide explique comment installer et configurer Misskey avec Docker.
|
||||||
|
|
||||||
[Version japonaise également disponible - Japanese version also available - 日本語版もあります](./docker.ja.md)
|
- [Version japonaise également disponible - Japanese version also available - 日本語版もあります](./docker.ja.md)
|
||||||
[Version anglaise également disponible - English version also available - 英語版もあります](./docker.en.md)
|
- [Version anglaise également disponible - English version also available - 英語版もあります](./docker.en.md)
|
||||||
|
- [Version Chinois simplifié également disponible - Simplified Chinese version also available - 简体中文版同样可用](./docker.zh.md)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,8 @@ Dockerを使ったMisskey構築方法
|
||||||
|
|
||||||
このガイドはDockerを使ったMisskeyセットアップ方法について解説します。
|
このガイドはDockerを使ったMisskeyセットアップ方法について解説します。
|
||||||
|
|
||||||
[英語版もあります - English version also available](./docker.en.md)
|
- [英語版もあります - English version also available](./docker.en.md)
|
||||||
|
- [简体中文版同样可用 - Simplified Chinese version also available](./docker.zh.md)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
Docker 部署指南
|
||||||
|
================================================================
|
||||||
|
|
||||||
|
这份指南描述了如何使用Docker安装并设置 Misskey 。
|
||||||
|
|
||||||
|
- [日本語版もあります - Japanese version also available](./docker.ja.md)
|
||||||
|
- [英語版もあります - English version also available](./docker.en.md)
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
*1.* 下载 Misskey
|
||||||
|
----------------------------------------------------------------
|
||||||
|
1. 克隆 Misskey 项目的 master 分支。
|
||||||
|
|
||||||
|
`git clone -b master git://github.com/syuilo/misskey.git`
|
||||||
|
|
||||||
|
2. 进入 misskey 文件夹。
|
||||||
|
|
||||||
|
`cd misskey`
|
||||||
|
|
||||||
|
3. 检查 [最新发布版](https://github.com/syuilo/misskey/releases/latest) 标签。
|
||||||
|
|
||||||
|
`git checkout master`
|
||||||
|
|
||||||
|
*2.* 配置 Misskey
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
可以按照如下方式创建配置文件:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
cd .config
|
||||||
|
cp example.yml default.yml
|
||||||
|
cp docker_example.env docker.env
|
||||||
|
```
|
||||||
|
|
||||||
|
### `default.yml`
|
||||||
|
|
||||||
|
这个文件的编辑工作基本与非 Docker 环境的版本相同。
|
||||||
|
但请注意, Postgresql、 Redis 和 Elasticsearch 的 **主机名(hostname)** 配置不应该是 `localhost` ,它们被设置在 `docker-compose.yml` 文件中。
|
||||||
|
以下是默认的主机名:
|
||||||
|
|
||||||
|
| 服务 | 主机名 |
|
||||||
|
|---------------|----------|
|
||||||
|
| Postgresql | `db` |
|
||||||
|
| Redis | `redis` |
|
||||||
|
| Elasticsearch | `es` |
|
||||||
|
|
||||||
|
### `docker.env`
|
||||||
|
|
||||||
|
在这个文件中配置 Postgresql 。
|
||||||
|
至少需要如下这些配置:
|
||||||
|
|
||||||
|
| 名称 | 描述 |
|
||||||
|
|---------------------|---------------|
|
||||||
|
| `POSTGRES_PASSWORD` | 数据库密码 |
|
||||||
|
| `POSTGRES_USER` | 数据库用户名 |
|
||||||
|
| `POSTGRES_DB` | 数据库名 |
|
||||||
|
|
||||||
|
*3.* 配置 Docker
|
||||||
|
----------------------------------------------------------------
|
||||||
|
编辑 `docker-compose.yml` 文件。
|
||||||
|
|
||||||
|
*4.* 构建 Misskey
|
||||||
|
----------------------------------------------------------------
|
||||||
|
使用如下的方式构建Misskey:
|
||||||
|
|
||||||
|
`docker-compose build`
|
||||||
|
|
||||||
|
*5.* 初始化数据库
|
||||||
|
----------------------------------------------------------------
|
||||||
|
``` bash
|
||||||
|
docker-compose run --rm web yarn run init
|
||||||
|
```
|
||||||
|
|
||||||
|
*6.* 完成了!
|
||||||
|
----------------------------------------------------------------
|
||||||
|
干得不错!现在您拥有了一个可以运行Misskey的环境啦。
|
||||||
|
|
||||||
|
### 正常启动
|
||||||
|
只需要 `docker-compose up -d` 即可。玩得愉快!
|
||||||
|
|
||||||
|
### 如何将您的 Misskey 服务器升级至最新版本
|
||||||
|
1. `git stash`
|
||||||
|
2. `git checkout master`
|
||||||
|
3. `git pull`
|
||||||
|
4. `git stash pop`
|
||||||
|
5. `docker-compose build`
|
||||||
|
6. 检查 [更新日志](../CHANGELOG.md) 以获取升级迁移信息。
|
||||||
|
7. `docker-compose stop && docker-compose up -d`
|
||||||
|
|
||||||
|
### 如何执行 [控制台指令](manage.zh.md):
|
||||||
|
`docker-compose run --rm web node built/tools/mark-admin @example`
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
如果您有任何疑问或是困惑,欢迎与我们联系!
|
|
@ -0,0 +1,14 @@
|
||||||
|
# 运营指南
|
||||||
|
|
||||||
|
## 检查任务队列的状态
|
||||||
|
即将到来……
|
||||||
|
|
||||||
|
## 设置用户为管理员
|
||||||
|
``` shell
|
||||||
|
node built/tools/mark-admin (用户名)
|
||||||
|
```
|
||||||
|
|
||||||
|
样例
|
||||||
|
``` shell
|
||||||
|
node built/tools/mark-admin @syuilo
|
||||||
|
```
|
|
@ -4,7 +4,8 @@ Misskey Setup and Installation Guide
|
||||||
We thank you for your interest in setting up your Misskey server!
|
We thank you for your interest in setting up your Misskey server!
|
||||||
This guide describes how to install and setup Misskey.
|
This guide describes how to install and setup Misskey.
|
||||||
|
|
||||||
[Japanese version also available - 日本語版もあります](./setup.ja.md)
|
- [Japanese version also available - 日本語版もあります](./setup.ja.md)
|
||||||
|
- [Simplified Chinese version also available - 简体中文版同样可用](./setup.zh.md)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,9 @@ Guide d'installation et de configuration de Misskey
|
||||||
Nous vous remerçions de l'intrêt que vous manifestez pour l'installation de votre propre instance Misskey !
|
Nous vous remerçions de l'intrêt que vous manifestez pour l'installation de votre propre instance Misskey !
|
||||||
Ce guide décrit les étapes à suivre afin d'installer et de configurer une instance Misskey.
|
Ce guide décrit les étapes à suivre afin d'installer et de configurer une instance Misskey.
|
||||||
|
|
||||||
[La version en japonnais est également disponible sur - 日本語版もあります](./setup.ja.md)
|
- [La version en japonnais est également disponible sur - 日本語版もあります](./setup.ja.md)
|
||||||
|
- [Version anglaise également disponible - English version also available - 英語版もあります](./setup.en.md)
|
||||||
|
- [Version Chinois simplifié également disponible - Simplified Chinese version also available - 简体中文版同样可用](./setup.zh.md)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,8 @@ Misskey構築の手引き
|
||||||
Misskeyサーバーの構築にご関心をお寄せいただきありがとうございます!
|
Misskeyサーバーの構築にご関心をお寄せいただきありがとうございます!
|
||||||
このガイドではMisskeyのインストール・セットアップ方法について解説します。
|
このガイドではMisskeyのインストール・セットアップ方法について解説します。
|
||||||
|
|
||||||
[英語版もあります - English version also available](./setup.en.md)
|
- [英語版もあります - English version also available](./setup.en.md)
|
||||||
|
- [简体中文版同样可用 - Simplified Chinese version also available](./setup.zh.md)
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,146 @@
|
||||||
|
Misskey 设置和安装指南
|
||||||
|
================================================================
|
||||||
|
|
||||||
|
非常感谢您对构建 Misskey 服务器的关注!
|
||||||
|
这份指南描述了 Misskey 的安装与设置流程。
|
||||||
|
|
||||||
|
- [日本語版もあります - Japanese version also available](./setup.ja.md)
|
||||||
|
- [英語版もあります - English version also available](./setup.en.md)
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
*1.* 创建 Misskey 用户
|
||||||
|
----------------------------------------------------------------
|
||||||
|
直接使用 root 用户来运行 misskey 也许并不是一个好主意,因此我们有必要创建一个专用的用户。
|
||||||
|
以 Debian 为例:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
adduser --disabled-password --disabled-login misskey
|
||||||
|
```
|
||||||
|
|
||||||
|
*2.* 安装依赖
|
||||||
|
----------------------------------------------------------------
|
||||||
|
请安装并设置如下这些软件:
|
||||||
|
|
||||||
|
#### Dependencies :package:
|
||||||
|
* **[Node.js](https://nodejs.org/en/)** (12.x, 14.x)
|
||||||
|
* **[PostgreSQL](https://www.postgresql.org/)** (>= 10)
|
||||||
|
* **[Redis](https://redis.io/)**
|
||||||
|
|
||||||
|
##### Optional
|
||||||
|
* [Yarn](https://yarnpkg.com/) *可选,但出于安全因素考虑还是推荐安装。如果您没有安装, 您需要使用 `npx yarn` 来代替 `yarn`.*
|
||||||
|
* [Elasticsearch](https://www.elastic.co/) - 为了启用搜索功能,这个搜索引擎是有必要的。
|
||||||
|
* [FFmpeg](https://www.ffmpeg.org/)
|
||||||
|
|
||||||
|
*3.* 安装 Misskey
|
||||||
|
----------------------------------------------------------------
|
||||||
|
1. 连接至 misskey 用户.
|
||||||
|
|
||||||
|
`su - misskey`
|
||||||
|
|
||||||
|
2. 克隆 Misskey 项目的 master 分支。
|
||||||
|
|
||||||
|
`git clone -b master git://github.com/syuilo/misskey.git`
|
||||||
|
|
||||||
|
3. 进入 misskey 文件夹。
|
||||||
|
|
||||||
|
`cd misskey`
|
||||||
|
|
||||||
|
4. 检查 [最新发布版](https://github.com/syuilo/misskey/releases/latest) 标签。
|
||||||
|
|
||||||
|
`git checkout master`
|
||||||
|
|
||||||
|
5. 安装 Misskey 的依赖。
|
||||||
|
|
||||||
|
`yarn`
|
||||||
|
|
||||||
|
*4.* 配置 Misskey
|
||||||
|
----------------------------------------------------------------
|
||||||
|
1. 复制 `.config/example.yml` 并重命名为 `default.yml`。
|
||||||
|
|
||||||
|
`cp .config/example.yml .config/default.yml`
|
||||||
|
|
||||||
|
2. 编辑 `default.yml`
|
||||||
|
|
||||||
|
*5.* 构建 Misskey
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
使用如下的指令构建 Misskey :
|
||||||
|
|
||||||
|
`NODE_ENV=production yarn build`
|
||||||
|
|
||||||
|
如果您使用的是 Debian , 您需要安装 `build-essential`, `python` 环境包。
|
||||||
|
|
||||||
|
如果您仍然遇到有关某些模块的错误,您可以使用 node-gyp:
|
||||||
|
|
||||||
|
1. `npx node-gyp configure`
|
||||||
|
2. `npx node-gyp build`
|
||||||
|
3. `NODE_ENV=production yarn build`
|
||||||
|
|
||||||
|
*6.* 初始化数据库
|
||||||
|
----------------------------------------------------------------
|
||||||
|
``` bash
|
||||||
|
yarn run init
|
||||||
|
```
|
||||||
|
|
||||||
|
*7.* 完成了!
|
||||||
|
----------------------------------------------------------------
|
||||||
|
干得不错!现在您拥有了一个可以运行Misskey的环境啦。
|
||||||
|
|
||||||
|
### 正常启动
|
||||||
|
只需要 `NODE_ENV=production npm start` 即可。玩得愉快!
|
||||||
|
|
||||||
|
### 使用 systemd 来启动
|
||||||
|
|
||||||
|
1. 在此处创建一个 systemd 服务:
|
||||||
|
|
||||||
|
`/etc/systemd/system/misskey.service`
|
||||||
|
|
||||||
|
2. 编辑它,粘贴如下内容并保存:
|
||||||
|
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
Description=Misskey daemon
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=misskey
|
||||||
|
ExecStart=/usr/bin/npm start
|
||||||
|
WorkingDirectory=/home/misskey/misskey
|
||||||
|
Environment="NODE_ENV=production"
|
||||||
|
TimeoutSec=60
|
||||||
|
StandardOutput=syslog
|
||||||
|
StandardError=syslog
|
||||||
|
SyslogIdentifier=misskey
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 重启 systemd 并设置 misskey 服务自动启动:
|
||||||
|
|
||||||
|
`systemctl daemon-reload ; systemctl enable misskey`
|
||||||
|
|
||||||
|
4. 启动 misskey 服务:
|
||||||
|
|
||||||
|
`systemctl start misskey`
|
||||||
|
|
||||||
|
您可以使用 `systemctl status misskey` 来检查服务是否正在运行。
|
||||||
|
|
||||||
|
### 如何将您的 Misskey 服务器升级至最新版本
|
||||||
|
1. `git checkout master`
|
||||||
|
2. `git pull`
|
||||||
|
3. `yarn install`
|
||||||
|
4. `NODE_ENV=production yarn build`
|
||||||
|
5. `yarn migrate`
|
||||||
|
6. 重启您的 Misskey 进程来应用改变。
|
||||||
|
7. 尽情享受吧!
|
||||||
|
|
||||||
|
如果您在更新时遇到任何问题,请尝试以下操作:
|
||||||
|
1. `yarn clean` 或是 `yarn cleanall`
|
||||||
|
2. 重试升级 (请不要忘记 `yarn install` )
|
||||||
|
|
||||||
|
----------------------------------------------------------------
|
||||||
|
|
||||||
|
如果您有任何疑问或是困惑,欢迎与我们联系!
|
|
@ -71,10 +71,10 @@
|
||||||
<button v-else class="button _button">
|
<button v-else class="button _button">
|
||||||
<fa :icon="faBan"/>
|
<fa :icon="faBan"/>
|
||||||
</button>
|
</button>
|
||||||
<button v-if="!isMyNote && appearNote.myReaction == null" class="button _button" @click="react()" ref="reactButton">
|
<button v-if="appearNote.myReaction == null" class="button _button" @click="react()" ref="reactButton">
|
||||||
<fa :icon="faPlus"/>
|
<fa :icon="faPlus"/>
|
||||||
</button>
|
</button>
|
||||||
<button v-if="!isMyNote && appearNote.myReaction != null" class="button _button reacted" @click="undoReact(appearNote)" ref="reactButton">
|
<button v-if="appearNote.myReaction != null" class="button _button reacted" @click="undoReact(appearNote)" ref="reactButton">
|
||||||
<fa :icon="faMinus"/>
|
<fa :icon="faMinus"/>
|
||||||
</button>
|
</button>
|
||||||
<button class="button _button" @click="menu()" ref="menuButton">
|
<button class="button _button" @click="menu()" ref="menuButton">
|
||||||
|
@ -407,18 +407,18 @@ export default defineComponent({
|
||||||
...this.appearNote,
|
...this.appearNote,
|
||||||
};
|
};
|
||||||
|
|
||||||
n.poll = {
|
const choices = [...this.appearNote.poll.choices];
|
||||||
...this.appearNote.poll,
|
choices[choice] = {
|
||||||
choices: {
|
...choices[choice],
|
||||||
...this.appearNote.poll.choices,
|
votes: choices[choice].votes + 1,
|
||||||
[choice]: {
|
|
||||||
...this.appearNote.poll.choices[choice],
|
|
||||||
votes: this.appearNote.poll.choices[choice].votes + 1,
|
|
||||||
...(body.userId === this.$store.state.i.id ? {
|
...(body.userId === this.$store.state.i.id ? {
|
||||||
isVoted: true
|
isVoted: true
|
||||||
} : {})
|
} : {})
|
||||||
}
|
};
|
||||||
}
|
|
||||||
|
n.poll = {
|
||||||
|
...this.appearNote.poll,
|
||||||
|
choices: choices
|
||||||
};
|
};
|
||||||
|
|
||||||
this.updateAppearNote(n);
|
this.updateAppearNote(n);
|
||||||
|
|
|
@ -51,11 +51,8 @@ export default defineComponent({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isMe(): boolean {
|
|
||||||
return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId;
|
|
||||||
},
|
|
||||||
canToggle(): boolean {
|
canToggle(): boolean {
|
||||||
return !this.reaction.match(/@\w/) && !this.isMe && this.$store.getters.isSignedIn;
|
return !this.reaction.match(/@\w/) && this.$store.getters.isSignedIn;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -18,8 +18,10 @@
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
<div class="sub">
|
<div class="sub">
|
||||||
|
<template v-if="$store.getters.isSignedIn">
|
||||||
<button v-if="widgetsEditMode" class="_button edit active" @click="widgetsEditMode = false"><fa :icon="faGripVertical"/></button>
|
<button v-if="widgetsEditMode" class="_button edit active" @click="widgetsEditMode = false"><fa :icon="faGripVertical"/></button>
|
||||||
<button v-else class="_button edit" @click="widgetsEditMode = true"><fa :icon="faGripVertical"/></button>
|
<button v-else class="_button edit" @click="widgetsEditMode = true"><fa :icon="faGripVertical"/></button>
|
||||||
|
</template>
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<fa :icon="faSearch"/>
|
<fa :icon="faSearch"/>
|
||||||
<input type="search" :placeholder="$t('search')" v-model="searchQuery" v-autocomplete="{ model: 'searchQuery' }" :disabled="searchWait" @keypress="searchKeypress"/>
|
<input type="search" :placeholder="$t('search')" v-model="searchQuery" v-autocomplete="{ model: 'searchQuery' }" :disabled="searchWait" @keypress="searchKeypress"/>
|
||||||
|
@ -141,7 +143,7 @@ export default defineComponent({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
widgets(): any[] {
|
widgets(): any {
|
||||||
if (this.$store.getters.isSignedIn) {
|
if (this.$store.getters.isSignedIn) {
|
||||||
const widgets = this.$store.state.deviceUser.widgets;
|
const widgets = this.$store.state.deviceUser.widgets;
|
||||||
return {
|
return {
|
||||||
|
@ -150,18 +152,24 @@ export default defineComponent({
|
||||||
mobile: widgets.filter(x => x.place === 'mobile'),
|
mobile: widgets.filter(x => x.place === 'mobile'),
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
const right = [{
|
||||||
left: [],
|
|
||||||
right: [{
|
|
||||||
name: 'welcome',
|
|
||||||
id: 'a', place: 'right', data: {}
|
|
||||||
}, {
|
|
||||||
name: 'calendar',
|
name: 'calendar',
|
||||||
id: 'b', place: 'right', data: {}
|
id: 'b', place: 'right', data: {}
|
||||||
}, {
|
}, {
|
||||||
name: 'trends',
|
name: 'trends',
|
||||||
id: 'c', place: 'right', data: {}
|
id: 'c', place: 'right', data: {}
|
||||||
}],
|
}];
|
||||||
|
|
||||||
|
if (this.$route.name !== 'index') {
|
||||||
|
right.unshift({
|
||||||
|
name: 'welcome',
|
||||||
|
id: 'a', place: 'right', data: {}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
left: [],
|
||||||
|
right,
|
||||||
mobile: [],
|
mobile: [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ export class UserProfile {
|
||||||
|
|
||||||
@Index()
|
@Index()
|
||||||
@Column('boolean', {
|
@Column('boolean', {
|
||||||
default: false,
|
default: false, select: false,
|
||||||
})
|
})
|
||||||
public enableWordMute: boolean;
|
public enableWordMute: boolean;
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,6 @@ export default async (actor: IRemoteUser, activity: ILike) => {
|
||||||
const note = await fetchNote(targetUri);
|
const note = await fetchNote(targetUri);
|
||||||
if (!note) return `skip: target note not found ${targetUri}`;
|
if (!note) return `skip: target note not found ${targetUri}`;
|
||||||
|
|
||||||
if (actor.id === note.userId) return `skip: cannot react to my note`;
|
|
||||||
|
|
||||||
await extractEmojis(activity.tag || [], actor.host).catch(() => null);
|
await extractEmojis(activity.tag || [], actor.host).catch(() => null);
|
||||||
|
|
||||||
await create(actor, note, activity._misskey_reaction || activity.content || activity.name);
|
await create(actor, note, activity._misskey_reaction || activity.content || activity.name);
|
||||||
|
|
|
@ -40,12 +40,6 @@ export const meta = {
|
||||||
id: '033d0620-5bfe-4027-965d-980b0c85a3ea'
|
id: '033d0620-5bfe-4027-965d-980b0c85a3ea'
|
||||||
},
|
},
|
||||||
|
|
||||||
isMyNote: {
|
|
||||||
message: 'You can not react to your own notes.',
|
|
||||||
code: 'IS_MY_NOTE',
|
|
||||||
id: '7eeb9714-b047-43b5-b559-7b1b72810f53'
|
|
||||||
},
|
|
||||||
|
|
||||||
alreadyReacted: {
|
alreadyReacted: {
|
||||||
message: 'You are already reacting to that note.',
|
message: 'You are already reacting to that note.',
|
||||||
code: 'ALREADY_REACTED',
|
code: 'ALREADY_REACTED',
|
||||||
|
@ -60,7 +54,6 @@ export default define(meta, async (ps, user) => {
|
||||||
throw e;
|
throw e;
|
||||||
});
|
});
|
||||||
await createReaction(user, note, ps.reaction).catch(e => {
|
await createReaction(user, note, ps.reaction).catch(e => {
|
||||||
if (e.id === '2d8e7297-1873-4c00-8404-792c68d7bef0') throw new ApiError(meta.errors.isMyNote);
|
|
||||||
if (e.id === '51c42bb4-931a-456b-bff7-e5a8a70dd298') throw new ApiError(meta.errors.alreadyReacted);
|
if (e.id === '51c42bb4-931a-456b-bff7-e5a8a70dd298') throw new ApiError(meta.errors.alreadyReacted);
|
||||||
throw e;
|
throw e;
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,11 +15,6 @@ import { createNotification } from '../../create-notification';
|
||||||
import deleteReaction from './delete';
|
import deleteReaction from './delete';
|
||||||
|
|
||||||
export default async (user: User, note: Note, reaction?: string) => {
|
export default async (user: User, note: Note, reaction?: string) => {
|
||||||
// Myself
|
|
||||||
if (note.userId === user.id) {
|
|
||||||
throw new IdentifiableError('2d8e7297-1873-4c00-8404-792c68d7bef0', 'cannot react to my note');
|
|
||||||
}
|
|
||||||
|
|
||||||
reaction = await toDbReaction(reaction, user.host);
|
reaction = await toDbReaction(reaction, user.host);
|
||||||
|
|
||||||
const exist = await NoteReactions.findOne({
|
const exist = await NoteReactions.findOne({
|
||||||
|
|
Loading…
Reference in New Issue