forked from jmug/stoatchat
Compare commits
79
Commits
20250210-1
...
20250807-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
050ba16d4a | ||
|
|
65bc6c8fc6 | ||
|
|
6ad3da5f35 | ||
|
|
947eb15771 | ||
|
|
f4ee35fb09 | ||
|
|
6048587d34 | ||
|
|
80cf8fc4e8 | ||
|
|
4f54227495 | ||
|
|
aab1734615 | ||
|
|
40a41ffd64 | ||
|
|
d30ceea373 | ||
|
|
3e8a401077 | ||
|
|
99f400bc7b | ||
|
|
73b576a75f | ||
|
|
4e4e598daf | ||
|
|
77daf82b94 | ||
|
|
e00603f276 | ||
|
|
1b2c7b2fa1 | ||
|
|
c526095d4f | ||
|
|
8cc4bbea4d | ||
|
|
911ffc767e | ||
|
|
1690df998d | ||
|
|
519d3c08a8 | ||
|
|
9846d8aac2 | ||
|
|
c74b6255dd | ||
|
|
df91b8c990 | ||
|
|
c4728c696d | ||
|
|
8153f5f17a | ||
|
|
99a80f723d | ||
|
|
4f13f5899b | ||
|
|
5362e84730 | ||
|
|
be89e62d54 | ||
|
|
a72134f4ad | ||
|
|
69ae767175 | ||
|
|
2aff76c369 | ||
|
|
01e0f9e558 | ||
|
|
8ea8f50fb8 | ||
|
|
68bcfcb626 | ||
|
|
9632a0dc1b | ||
|
|
a4a0934475 | ||
|
|
2061794305 | ||
|
|
3a7ebad883 | ||
|
|
6daa8223b2 | ||
|
|
4a58d6eae0 | ||
|
|
a8a2e491b0 | ||
|
|
f98f09a5ea | ||
|
|
7a4e12a732 | ||
|
|
aa8f8575bc | ||
|
|
70d6a5ac08 | ||
|
|
7f85ad5e7b | ||
|
|
c785ae615d | ||
|
|
9c8a362e9f | ||
|
|
e708c612cf | ||
|
|
f75d635c81 | ||
|
|
29b6ac3acf | ||
|
|
a1b0e4767a | ||
|
|
f4281c7050 | ||
|
|
d2e83c94f3 | ||
|
|
2540860129 | ||
|
|
93a5de769d | ||
|
|
717d5e9a88 | ||
|
|
18f06467bb | ||
|
|
8d88ea9963 | ||
|
|
e3e1cab02e | ||
|
|
00bd56b687 | ||
|
|
a7727bba5c | ||
|
|
6b8005f530 | ||
|
|
714fba7ea6 | ||
|
|
ac05fb385c | ||
|
|
537c147c4b | ||
|
|
7bee609b84 | ||
|
|
859c0214ec | ||
|
|
5eea0bbc9a | ||
|
|
15dec656a8 | ||
|
|
bcf6561c0c | ||
|
|
b177a3e201 | ||
|
|
d1236bf8f2 | ||
|
|
01490f5723 | ||
|
|
3ceefb840b |
@@ -1,2 +1,2 @@
|
|||||||
[profile.default]
|
[profile.default]
|
||||||
slow-timeout = { period = "3s", terminate-after = 2 }
|
slow-timeout = { period = "5s", terminate-after = 10 }
|
||||||
|
|||||||
+121
-69
@@ -2,24 +2,13 @@ name: Docker Test & Publish
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# branches:
|
|
||||||
# - "main"
|
|
||||||
tags:
|
tags:
|
||||||
- "*"
|
- "*"
|
||||||
paths-ignore:
|
|
||||||
- ".github/**"
|
|
||||||
- "!.github/workflows/docker.yml"
|
|
||||||
- ".vscode/**"
|
|
||||||
- "doc/**"
|
|
||||||
- ".gitignore"
|
|
||||||
- "LICENSE"
|
|
||||||
- "README"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
paths:
|
paths:
|
||||||
- "Dockerfile"
|
- "Dockerfile"
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -27,8 +16,9 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
base:
|
base:
|
||||||
|
name: Test base image build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build base image
|
if: github.event_name == 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
# Configure build environment
|
# Configure build environment
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -36,33 +26,21 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
# Authenticate with GHCR
|
# Build the image
|
||||||
- name: Login to Github Container Registry
|
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build base image
|
- name: Build base image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: false
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
tags: ghcr.io/${{ github.repository_owner }}/base:latest
|
tags: ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
cache-from: type=gha,scope=buildx-base-multi-arch
|
cache-from: type=gha,scope=buildx-base-multi-arch
|
||||||
cache-to: type=gha,scope=buildx-base-multi-arch,mode=max
|
cache-to: type=gha,scope=buildx-base-multi-arch,mode=max
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: [base]
|
runs-on: self-hosted
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
strategy:
|
name: Publish Docker images
|
||||||
matrix:
|
|
||||||
project: [delta, bonfire, autumn, january, pushd]
|
|
||||||
name: Build ${{ matrix.project }} image
|
|
||||||
steps:
|
steps:
|
||||||
# Configure build environment
|
# Configure build environment
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -77,6 +55,7 @@ jobs:
|
|||||||
registry: docker.io
|
registry: docker.io
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to Github Container Registry
|
- name: Login to Github Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -84,58 +63,131 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# Resolve the correct project
|
# Build the image
|
||||||
- uses: kanga333/variable-mapper@master
|
- name: Build base image
|
||||||
id: export
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
key: "${{ matrix.project }}"
|
context: .
|
||||||
map: |
|
push: true
|
||||||
{
|
platforms: linux/amd64,linux/arm64
|
||||||
"delta": {
|
tags: ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
"path": "crates/delta",
|
|
||||||
"tag": "${{ github.repository_owner }}/server"
|
|
||||||
},
|
|
||||||
"bonfire": {
|
|
||||||
"path": "crates/bonfire",
|
|
||||||
"tag": "${{ github.repository_owner }}/bonfire"
|
|
||||||
},
|
|
||||||
"autumn": {
|
|
||||||
"path": "crates/services/autumn",
|
|
||||||
"tag": "${{ github.repository_owner }}/autumn"
|
|
||||||
},
|
|
||||||
"january": {
|
|
||||||
"path": "crates/services/january",
|
|
||||||
"tag": "${{ github.repository_owner }}/january"
|
|
||||||
},
|
|
||||||
"pushd": {
|
|
||||||
"path": "crates/daemons/pushd",
|
|
||||||
"tag": "${{ github.repository_owner }}/pushd"
|
|
||||||
},
|
|
||||||
"crond": {
|
|
||||||
"path": "crates/daemons/crond",
|
|
||||||
"tag": "${{ github.repository_owner }}/crond"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export_to: output
|
|
||||||
|
|
||||||
# Configure metadata
|
# revoltchat/server
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta
|
id: meta-delta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/${{ steps.export.outputs.tag }}
|
docker.io/revoltchat/server
|
||||||
ghcr.io/${{ steps.export.outputs.tag }}
|
ghcr.io/revoltchat/server
|
||||||
|
|
||||||
# Build crate image
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
file: ${{ steps.export.outputs.path }}/Dockerfile
|
file: crates/delta/Dockerfile
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta-delta.outputs.tags }}
|
||||||
build-args: |
|
build-args: |
|
||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta-delta.outputs.labels }}
|
||||||
|
|
||||||
|
# revoltchat/bonfire
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta-bonfire
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
docker.io/revoltchat/bonfire
|
||||||
|
ghcr.io/revoltchat/bonfire
|
||||||
|
- name: Publish
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
file: crates/bonfire/Dockerfile
|
||||||
|
tags: ${{ steps.meta-bonfire.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
labels: ${{ steps.meta-bonfire.outputs.labels }}
|
||||||
|
|
||||||
|
# revoltchat/autumn
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta-autumn
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
docker.io/revoltchat/autumn
|
||||||
|
ghcr.io/revoltchat/autumn
|
||||||
|
- name: Publish
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
file: crates/services/autumn/Dockerfile
|
||||||
|
tags: ${{ steps.meta-autumn.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
labels: ${{ steps.meta-autumn.outputs.labels }}
|
||||||
|
|
||||||
|
# revoltchat/january
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta-january
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
docker.io/revoltchat/january
|
||||||
|
ghcr.io/revoltchat/january
|
||||||
|
- name: Publish
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
file: crates/services/january/Dockerfile
|
||||||
|
tags: ${{ steps.meta-january.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
labels: ${{ steps.meta-january.outputs.labels }}
|
||||||
|
|
||||||
|
# revoltchat/crond
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta-crond
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
docker.io/revoltchat/crond
|
||||||
|
ghcr.io/revoltchat/crond
|
||||||
|
- name: Publish
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
file: crates/daemons/crond/Dockerfile
|
||||||
|
tags: ${{ steps.meta-crond.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
labels: ${{ steps.meta-crond.outputs.labels }}
|
||||||
|
|
||||||
|
# revoltchat/pushd
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta-pushd
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
docker.io/revoltchat/pushd
|
||||||
|
ghcr.io/revoltchat/pushd
|
||||||
|
- name: Publish
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
file: crates/daemons/pushd/Dockerfile
|
||||||
|
tags: ${{ steps.meta-pushd.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
labels: ${{ steps.meta-pushd.outputs.labels }}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ compose.override.yml
|
|||||||
target
|
target
|
||||||
.data
|
.data
|
||||||
.env
|
.env
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
|
||||||
.vercel
|
.vercel
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"rust-analyzer.checkOnSave.command": "clippy",
|
"rust-analyzer.check.command": "clippy",
|
||||||
"nixEnvSelector.suggestion": false,
|
"nixEnvSelector.suggestion": false,
|
||||||
"nixEnvSelector.nixFile": "${workspaceFolder}/default.nix"
|
"nixEnvSelector.nixFile": "${workspaceFolder}/default.nix"
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+3091
-2054
File diff suppressed because it is too large
Load Diff
+6
-8
@@ -6,19 +6,17 @@ members = [
|
|||||||
"crates/bonfire",
|
"crates/bonfire",
|
||||||
"crates/core/*",
|
"crates/core/*",
|
||||||
"crates/services/*",
|
"crates/services/*",
|
||||||
"crates/bindings/*",
|
|
||||||
"crates/daemons/*",
|
"crates/daemons/*",
|
||||||
]
|
]
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
redis22 = { package = "redis", version = "0.22.3", git = "https://github.com/revoltchat/redis-rs", rev = "1a41faf356fd21aebba71cea7eb7eb2653e5f0ef" }
|
redis23 = { package = "redis", version = "0.23.3", git = "https://github.com/revoltchat/redis-rs", rev = "523b2937367e17bd0073722bf6e23d06042cb4e4" }
|
||||||
redis23 = { package = "redis", version = "0.23.1", git = "https://github.com/revoltchat/redis-rs", rev = "f8ca28ab85da59d2ccde526b4d2fb390eff5a5f9" }
|
#authifier = { package = "authifier", version = "1.0.10", path = "../authifier/crates/authifier" }
|
||||||
# authifier = { package = "authifier", version = "1.0.8", path = "../authifier/crates/authifier" }
|
#rocket_authifier = { package = "rocket_authifier", version = "1.0.10", path = "../authifier/crates/rocket_authifier" }
|
||||||
# rocket_authifier = { package = "rocket_authifier", version = "1.0.8", path = "../authifier/crates/rocket_authifier" }
|
|
||||||
|
|
||||||
# I'm 99% sure this is overloading the GitHub worker
|
# I'm 99% sure this is overloading the GitHub worker
|
||||||
# hence builds have been failing since, let's just
|
# hence builds have been failing since, let's just
|
||||||
# disable it for now. In the future, we could use this
|
# disable it for now. In the future, we could use this
|
||||||
# if we were rolling our own CI.
|
# if we were rolling our own CI (that is now).
|
||||||
# [profile.release]
|
[profile.release]
|
||||||
# lto = true
|
lto = true
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM --platform="${BUILDPLATFORM}" rust:1.77.2-slim-bookworm
|
FROM --platform="${BUILDPLATFORM}" rust:1.86.0-slim-bookworm
|
||||||
USER 0:0
|
USER 0:0
|
||||||
WORKDIR /home/rust/src
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
@@ -17,13 +17,13 @@ RUN sh /tmp/build-image-layer.sh tools
|
|||||||
|
|
||||||
# Build all dependencies
|
# Build all dependencies
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
COPY crates/bindings/node/Cargo.toml ./crates/bindings/node/
|
|
||||||
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
||||||
COPY crates/delta/Cargo.toml ./crates/delta/
|
COPY crates/delta/Cargo.toml ./crates/delta/
|
||||||
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
||||||
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
||||||
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
||||||
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
||||||
|
COPY crates/core/parser/Cargo.toml ./crates/core/parser/
|
||||||
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
||||||
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
||||||
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM rust:1.77.2-slim-bookworm
|
FROM rust:1.86.0-slim-bookworm
|
||||||
USER 0:0
|
USER 0:0
|
||||||
WORKDIR /home/rust/src
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
@@ -13,13 +13,13 @@ COPY scripts/build-image-layer.sh /tmp/
|
|||||||
|
|
||||||
# Build all dependencies
|
# Build all dependencies
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
COPY crates/bindings/node/Cargo.toml ./crates/bindings/node/
|
|
||||||
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
COPY crates/bonfire/Cargo.toml ./crates/bonfire/
|
||||||
COPY crates/delta/Cargo.toml ./crates/delta/
|
COPY crates/delta/Cargo.toml ./crates/delta/
|
||||||
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
COPY crates/core/config/Cargo.toml ./crates/core/config/
|
||||||
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
COPY crates/core/database/Cargo.toml ./crates/core/database/
|
||||||
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
COPY crates/core/files/Cargo.toml ./crates/core/files/
|
||||||
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
COPY crates/core/models/Cargo.toml ./crates/core/models/
|
||||||
|
COPY crates/core/parser/Cargo.toml ./crates/core/parser/
|
||||||
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
COPY crates/core/permissions/Cargo.toml ./crates/core/permissions/
|
||||||
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
COPY crates/core/presence/Cargo.toml ./crates/core/presence/
|
||||||
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
COPY crates/core/result/Cargo.toml ./crates/core/result/
|
||||||
|
|||||||
@@ -12,32 +12,31 @@
|
|||||||
The services and libraries that power the Revolt service.<br/>
|
The services and libraries that power the Revolt service.<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
| Crate | Path | Description | |
|
| Crate | Path | Description | |
|
||||||
| ------------------ | -------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------ | -------------------------------------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `core/config` | [crates/core/config](crates/core/config) | Core: Configuration |     |
|
| `core/config` | [crates/core/config](crates/core/config) | Core: Configuration |     |
|
||||||
| `core/database` | [crates/core/database](crates/core/database) | Core: Database Implementation |     |
|
| `core/database` | [crates/core/database](crates/core/database) | Core: Database Implementation |     |
|
||||||
| `core/files` | [crates/core/files](crates/core/files) | Core: S3 and encryption subroutines |     |
|
| `core/files` | [crates/core/files](crates/core/files) | Core: S3 and encryption subroutines |     |
|
||||||
| `core/models` | [crates/core/models](crates/core/models) | Core: API Models |     |
|
| `core/models` | [crates/core/models](crates/core/models) | Core: API Models |     |
|
||||||
| `core/permissions` | [crates/core/permissions](crates/core/permissions) | Core: Permission Logic |     |
|
| `core/permissions` | [crates/core/permissions](crates/core/permissions) | Core: Permission Logic |     |
|
||||||
| `core/presence` | [crates/core/presence](crates/core/presence) | Core: User Presence |     |
|
| `core/presence` | [crates/core/presence](crates/core/presence) | Core: User Presence |     |
|
||||||
| `core/result` | [crates/core/result](crates/core/result) | Core: Result and Error types |     |
|
| `core/result` | [crates/core/result](crates/core/result) | Core: Result and Error types |     |
|
||||||
| `delta` | [crates/delta](crates/delta) | REST API server |  |
|
| `delta` | [crates/delta](crates/delta) | REST API server |  |
|
||||||
| `bonfire` | [crates/bonfire](crates/bonfire) | WebSocket events server |  |
|
| `bonfire` | [crates/bonfire](crates/bonfire) | WebSocket events server |  |
|
||||||
| `services/january` | [crates/services/january](crates/services/january) | Proxy server |  |
|
| `services/january` | [crates/services/january](crates/services/january) | Proxy server |  |
|
||||||
| `services/autumn` | [crates/services/autumn](crates/services/autumn) | File server |  |
|
| `services/autumn` | [crates/services/autumn](crates/services/autumn) | File server |  |
|
||||||
| `bindings/node` | [crates/bindings/node](crates/bindings/node) | Node.js bindings for the Revolt software |  |
|
| `daemons/crond` | [crates/daemons/crond](crates/daemons/crond) | Timed data clean up daemon server |  |
|
||||||
| `daemons/crond` | [crates/daemons/crond](crates/daemons/crond) | Timed data clean up daemon server |  |
|
| `daemons/pushd` | [crates/daemons/pushd](crates/daemons/pushd) | Push notification daemon server |  |
|
||||||
| `daemons/pushd` | [crates/daemons/pushd](crates/daemons/pushd) | Push notification daemon server |  |
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
## Minimum Supported Rust Version
|
## Minimum Supported Rust Version
|
||||||
|
|
||||||
Rust 1.76 or higher.
|
Rust 1.86.0 or higher.
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
> The events server has a significant performance regression between Rust 1.77.2 and 1.78.0 onwards, see [issue #341](https://github.com/revoltchat/backend/issues/341).
|
> The events server has a significant performance regression between Rust 1.77.2 and 1.78.0 onwards, see [issue #341](https://github.com/revoltchat/backend/issues/341). This is currently solved by build time options but we are looking for a proper fix.
|
||||||
|
|
||||||
## Development Guide
|
## Development Guide
|
||||||
|
|
||||||
@@ -115,7 +114,8 @@ If you'd like to change anything, create a `Revolt.overrides.toml` file and spec
|
|||||||
> And corresponding Revolt configuration:
|
> And corresponding Revolt configuration:
|
||||||
>
|
>
|
||||||
> ```toml
|
> ```toml
|
||||||
> # Revolt.overrides.toml
|
> # Revolt.overrides.toml
|
||||||
|
> # and Revolt.test-overrides.toml
|
||||||
> [database]
|
> [database]
|
||||||
> mongodb = "mongodb://127.0.0.1:14017"
|
> mongodb = "mongodb://127.0.0.1:14017"
|
||||||
> redis = "redis://127.0.0.1:14079/"
|
> redis = "redis://127.0.0.1:14079/"
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,5 @@
|
|||||||
# ⚠️ This configuration is intended for development environment.
|
# ⚠️ This configuration is intended for development environment.
|
||||||
# If you'd like to override anything, create a Revolt.override.toml
|
# If you'd like to override anything, create a Revolt.overrides.toml
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
# MongoDB connection URL
|
# MongoDB connection URL
|
||||||
@@ -38,6 +38,7 @@ from_address = "development@revolt.chat"
|
|||||||
reply_to = "support@revolt.chat"
|
reply_to = "support@revolt.chat"
|
||||||
port = 14025
|
port = 14025
|
||||||
use_tls = false
|
use_tls = false
|
||||||
|
use_starttls = false
|
||||||
|
|
||||||
[files.s3]
|
[files.s3]
|
||||||
# S3 protocol endpoint
|
# S3 protocol endpoint
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ services:
|
|||||||
- minio
|
- minio
|
||||||
entrypoint: >
|
entrypoint: >
|
||||||
/bin/sh -c "while ! /usr/bin/mc ready minio; do
|
/bin/sh -c "while ! /usr/bin/mc ready minio; do
|
||||||
/usr/bin/mc config host add minio http://minio:9000 minioautumn minioautumn;
|
/usr/bin/mc alias set minio http://minio:9000 minioautumn minioautumn;
|
||||||
echo 'Waiting minio...' && sleep 1;
|
echo 'Waiting minio...' && sleep 1;
|
||||||
done; /usr/bin/mc mb minio/revolt-uploads; exit 0;"
|
done; /usr/bin/mc mb minio/revolt-uploads; exit 0;"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
target
|
|
||||||
index.node
|
|
||||||
**/node_modules
|
|
||||||
**/.DS_Store
|
|
||||||
npm-debug.log*
|
|
||||||
cargo.log
|
|
||||||
cross.log
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "revolt-nodejs-bindings"
|
|
||||||
version = "0.8.2"
|
|
||||||
description = "Node.js bindings for the Revolt software"
|
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
|
||||||
license = "MIT"
|
|
||||||
edition = "2021"
|
|
||||||
exclude = ["index.node"]
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
crate-type = ["cdylib"]
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
neon = "1.0.0"
|
|
||||||
neon-serde4 = "1.0.0"
|
|
||||||
|
|
||||||
serde = { version = "1", features = ["derive"] }
|
|
||||||
|
|
||||||
async-std = "1.12.0"
|
|
||||||
|
|
||||||
revolt-config = { version = "0.8.2", path = "../../core/config" }
|
|
||||||
revolt-result = { version = "0.8.2", path = "../../core/result" }
|
|
||||||
revolt-database = { version = "0.8.2", path = "../../core/database" }
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
# revolt.node
|
|
||||||
|
|
||||||
**revolt.node:** Node.js bindings for the Revolt software
|
|
||||||
|
|
||||||
This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon).
|
|
||||||
|
|
||||||
## Building revolt.node
|
|
||||||
|
|
||||||
Building revolt.node requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support).
|
|
||||||
|
|
||||||
To run the build, run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ npm run build
|
|
||||||
```
|
|
||||||
|
|
||||||
This command uses the [@neon-rs/cli](https://www.npmjs.com/package/@neon-rs/cli) utility to assemble the binary Node addon from the output of `cargo`.
|
|
||||||
|
|
||||||
## Exploring revolt.node
|
|
||||||
|
|
||||||
After building revolt.node, you can explore its exports at the Node console:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ npm i
|
|
||||||
$ npm run build
|
|
||||||
$ node
|
|
||||||
> require('.').hello()
|
|
||||||
'hello node'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Available Scripts
|
|
||||||
|
|
||||||
In the project directory, you can run:
|
|
||||||
|
|
||||||
#### `npm install`
|
|
||||||
|
|
||||||
Installs the project, including running `npm run build`.
|
|
||||||
|
|
||||||
#### `npm run build`
|
|
||||||
|
|
||||||
Builds the Node addon (`index.node`) from source, generating a release build with `cargo --release`.
|
|
||||||
|
|
||||||
Additional [`cargo build`](https://doc.rust-lang.org/cargo/commands/cargo-build.html) arguments may be passed to `npm run build` and similar commands. For example, to enable a [cargo feature](https://doc.rust-lang.org/cargo/reference/features.html):
|
|
||||||
|
|
||||||
```
|
|
||||||
npm run build -- --feature=beetle
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `npm run debug`
|
|
||||||
|
|
||||||
Similar to `npm run build` but generates a debug build with `cargo`.
|
|
||||||
|
|
||||||
#### `npm run cross`
|
|
||||||
|
|
||||||
Similar to `npm run build` but uses [cross-rs](https://github.com/cross-rs/cross) to cross-compile for another platform. Use the [`CARGO_BUILD_TARGET`](https://doc.rust-lang.org/cargo/reference/config.html#buildtarget) environment variable to select the build target.
|
|
||||||
|
|
||||||
#### `npm test`
|
|
||||||
|
|
||||||
Runs the unit tests by calling `cargo test`. You can learn more about [adding tests to your Rust code](https://doc.rust-lang.org/book/ch11-01-writing-tests.html) from the [Rust book](https://doc.rust-lang.org/book/).
|
|
||||||
|
|
||||||
## Project Layout
|
|
||||||
|
|
||||||
The directory structure of this project is:
|
|
||||||
|
|
||||||
```
|
|
||||||
revolt.node/
|
|
||||||
├── Cargo.toml
|
|
||||||
├── README.md
|
|
||||||
├── src/
|
|
||||||
| └── lib.rs
|
|
||||||
├── index.node
|
|
||||||
├── package.json
|
|
||||||
└── target/
|
|
||||||
```
|
|
||||||
|
|
||||||
| Entry | Purpose |
|
|
||||||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `Cargo.toml` | The Cargo [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html), which informs the `cargo` command. |
|
|
||||||
| `README.md` | This file. |
|
|
||||||
| `src/` | The directory tree containing the Rust source code for the project. |
|
|
||||||
| `lib.rs` | Entry point for the Rust source code. |
|
|
||||||
| `index.node` | The main module, a [Node addon](https://nodejs.org/api/addons.html) generated by the build and pointed to by `"main"` in `package.json`. |
|
|
||||||
| `package.json` | The npm [manifest file](https://docs.npmjs.com/cli/v7/configuring-npm/package-json), which informs the `npm` command. |
|
|
||||||
| `target/` | Binary artifacts generated by the Rust build. |
|
|
||||||
|
|
||||||
## Learn More
|
|
||||||
|
|
||||||
Learn more about:
|
|
||||||
|
|
||||||
- [Neon](https://neon-bindings.com).
|
|
||||||
- [Rust](https://www.rust-lang.org).
|
|
||||||
- [Node](https://nodejs.org).
|
|
||||||
Vendored
-84
@@ -1,84 +0,0 @@
|
|||||||
import { Channel, User } from "revolt-api";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Opaque type for Revolt database
|
|
||||||
*/
|
|
||||||
export declare interface Database {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Opaque type for Revolt database
|
|
||||||
*/
|
|
||||||
export declare interface OpaqueUser {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Error type from Revolt backend
|
|
||||||
*/
|
|
||||||
export declare interface Err {
|
|
||||||
type: string;
|
|
||||||
location: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialises background tasks and logging, must be called before anything else!
|
|
||||||
* Can be called multiple times!
|
|
||||||
*/
|
|
||||||
export declare function init();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a new handle to the Revolt database
|
|
||||||
* @returns {Database} Handle
|
|
||||||
*/
|
|
||||||
export declare function database(): Database;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch user from database
|
|
||||||
* @param {string} userId User's ID
|
|
||||||
* @this {Database}
|
|
||||||
*/
|
|
||||||
export declare function database_fetch_user(userId: string): OpaqueUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch user from database
|
|
||||||
* @param {string} username Username
|
|
||||||
* @param {string} discriminator Discriminator
|
|
||||||
* @this {Database}
|
|
||||||
*/
|
|
||||||
export declare function database_fetch_user_by_username(
|
|
||||||
username: string,
|
|
||||||
discriminator: string
|
|
||||||
): OpaqueUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets model data as JSON
|
|
||||||
* @this {OpaqueUser}
|
|
||||||
*/
|
|
||||||
export declare function model_data(): User;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets error if the model failed to fetch
|
|
||||||
* @this {OpaqueUser}
|
|
||||||
*/
|
|
||||||
export declare function model_error(): Err;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a direct message channel between two users
|
|
||||||
* @param {string} userA User A ID
|
|
||||||
* @param {string} userB User B ID
|
|
||||||
* @returns Existing or newly created channel
|
|
||||||
*/
|
|
||||||
export declare function proc_channels_create_dm(
|
|
||||||
userA: string,
|
|
||||||
userB: string
|
|
||||||
): Promise<Channel & { error: Err }>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Suspend a user
|
|
||||||
* @param {string} user User
|
|
||||||
* @param {number} duration Duration (in days), set to 0 for indefinite
|
|
||||||
* @param {string} reason Pipe-separated list of reasons (e.g. reason1|reason2|reason3)
|
|
||||||
*/
|
|
||||||
export declare function proc_users_suspend(
|
|
||||||
user: OpaqueUser,
|
|
||||||
duration: number,
|
|
||||||
reason: string
|
|
||||||
): Promise<{ error: Err }>;
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "revolt-nodejs-bindings",
|
|
||||||
"version": "0.7.15-rev0.0.3",
|
|
||||||
"description": "Node.js bindings for the Revolt software",
|
|
||||||
"main": "index.node",
|
|
||||||
"scripts": {
|
|
||||||
"test": "cargo test",
|
|
||||||
"cargo-build": "cargo build --message-format=json > cargo.log",
|
|
||||||
"cross-build": "cross build --message-format=json > cross.log",
|
|
||||||
"postcargo-build": "neon dist < cargo.log",
|
|
||||||
"postcross-build": "neon dist -m /target < cross.log",
|
|
||||||
"debug": "npm run cargo-build --",
|
|
||||||
"build": "npm run cargo-build -- --release",
|
|
||||||
"cross": "npm run cross-build -- --release"
|
|
||||||
},
|
|
||||||
"author": "Paul Makles",
|
|
||||||
"license": "AGPL-3.0",
|
|
||||||
"devDependencies": {
|
|
||||||
"@neon-rs/cli": "0.1.73"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/revoltchat/backend"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"revolt",
|
|
||||||
"chat"
|
|
||||||
],
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/revoltchat/backend/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/revoltchat/backend#readme",
|
|
||||||
"dependencies": {
|
|
||||||
"revolt-api": "^0.7.15"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Generated
-117
@@ -1,117 +0,0 @@
|
|||||||
lockfileVersion: '6.0'
|
|
||||||
|
|
||||||
settings:
|
|
||||||
autoInstallPeers: true
|
|
||||||
excludeLinksFromLockfile: false
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
revolt-api:
|
|
||||||
specifier: ^0.7.15
|
|
||||||
version: 0.7.15
|
|
||||||
|
|
||||||
devDependencies:
|
|
||||||
'@neon-rs/cli':
|
|
||||||
specifier: 0.1.73
|
|
||||||
version: 0.1.73
|
|
||||||
|
|
||||||
packages:
|
|
||||||
|
|
||||||
/@cargo-messages/android-arm-eabi@0.1.72:
|
|
||||||
resolution: {integrity: sha512-gGZxIM1mj+Y5x+ULND6ZCNr7f70OJi9wDlycSK8hGONy9wrChN6JAIHryddC5cqcwlYAoQ6IDcDFElnhAYbybA==}
|
|
||||||
cpu: [arm]
|
|
||||||
os: [android]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/darwin-arm64@0.1.72:
|
|
||||||
resolution: {integrity: sha512-EAzN5MLaXPljZKZDO5qR+aBs44eSq2ZbEnS7AI/FziE3MzeXbrGOS3fLba5+7yWPFXJyZolXzePm8N1EBv8ovg==}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [darwin]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/darwin-x64@0.1.72:
|
|
||||||
resolution: {integrity: sha512-RLo6j8s3nYbjdd1LDct4wamfChyRit7zokUuxtIYCu9XOlltkN5vnj1vwnrPvoqCMZ/7CbbuHFwSTn9A71de/w==}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [darwin]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/linux-arm-gnueabihf@0.1.72:
|
|
||||||
resolution: {integrity: sha512-tHsRshuzfjrX6SDW3jg6al8vMNLTMgczGnVYl5RuBZf/yrAUuwe30KxA9ge6w6mW6Ox797DyBchzAc9OLgTgmQ==}
|
|
||||||
cpu: [arm]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/linux-x64-gnu@0.1.72:
|
|
||||||
resolution: {integrity: sha512-VGtL6CCnUbhsP4aYuBNT5kfrAL7o0qjrxw97a+ax13t+nJd26tVEEIKHMu5drvvS/Nm/hn7sLT8zMnnCv0pvHg==}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [linux]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/win32-arm64-msvc@0.1.72:
|
|
||||||
resolution: {integrity: sha512-V93Cgz39K+yqa3MveNbhh29pYCp8izK5uEavjPoxlNxAbsMCWH+s0verGDdUcfGxjR1H2V7oZ4FszPqR2SqMRQ==}
|
|
||||||
cpu: [arm64]
|
|
||||||
os: [win32]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@cargo-messages/win32-x64-msvc@0.1.72:
|
|
||||||
resolution: {integrity: sha512-knz3uSrO0OSbq3U5VWfCY8FB4NsM43BOWLZ7x4sfaMOC1XWv+IyvDdkLe6DhJx8KUw46KIAimYs9YROrp6l46Q==}
|
|
||||||
cpu: [x64]
|
|
||||||
os: [win32]
|
|
||||||
requiresBuild: true
|
|
||||||
dev: true
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/@neon-rs/cli@0.1.73:
|
|
||||||
resolution: {integrity: sha512-1kv8S/feB6UQWQQwsnGfkSkEBOtlFDNExnioL81E2BwvUWgjQPaseHgpi2EpWVgsPUgur5eBm4QowmlpWkD4/w==}
|
|
||||||
hasBin: true
|
|
||||||
optionalDependencies:
|
|
||||||
'@cargo-messages/android-arm-eabi': 0.1.72
|
|
||||||
'@cargo-messages/darwin-arm64': 0.1.72
|
|
||||||
'@cargo-messages/darwin-x64': 0.1.72
|
|
||||||
'@cargo-messages/linux-arm-gnueabihf': 0.1.72
|
|
||||||
'@cargo-messages/linux-x64-gnu': 0.1.72
|
|
||||||
'@cargo-messages/win32-arm64-msvc': 0.1.72
|
|
||||||
'@cargo-messages/win32-x64-msvc': 0.1.72
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/axios@0.26.1:
|
|
||||||
resolution: {integrity: sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==}
|
|
||||||
dependencies:
|
|
||||||
follow-redirects: 1.15.6
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- debug
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/follow-redirects@1.15.6:
|
|
||||||
resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
|
|
||||||
engines: {node: '>=4.0'}
|
|
||||||
peerDependencies:
|
|
||||||
debug: '*'
|
|
||||||
peerDependenciesMeta:
|
|
||||||
debug:
|
|
||||||
optional: true
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/lodash.defaultsdeep@4.6.1:
|
|
||||||
resolution: {integrity: sha512-3j8wdDzYuWO3lM3Reg03MuQR957t287Rpcxp1njpEa8oDrikb+FwGdW3n+FELh/A6qib6yPit0j/pv9G/yeAqA==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/revolt-api@0.7.15:
|
|
||||||
resolution: {integrity: sha512-rWRnjBFvoXt/RHRxHg9KuP+x1Jk61KdsOpKOczVJg5tIqGDmqp/6QZHw5rJTtG+wCH3Ah3YKwY+MM5NHfg1W3Q==}
|
|
||||||
dependencies:
|
|
||||||
axios: 0.26.1
|
|
||||||
lodash.defaultsdeep: 4.6.1
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- debug
|
|
||||||
dev: false
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
#[macro_use]
|
|
||||||
extern crate serde;
|
|
||||||
|
|
||||||
use std::sync::OnceLock;
|
|
||||||
|
|
||||||
use neon::prelude::*;
|
|
||||||
use revolt_database::{Database, DatabaseInfo};
|
|
||||||
|
|
||||||
fn js_init(mut cx: FunctionContext) -> JsResult<JsUndefined> {
|
|
||||||
// static INIT: OnceLock<()> = OnceLock::new();
|
|
||||||
// if INIT.get().is_none() {
|
|
||||||
// INIT.get_or_init(|| {
|
|
||||||
// async_std::task::block_on(async {
|
|
||||||
// revolt_config::configure!(api);
|
|
||||||
|
|
||||||
// match DatabaseInfo::Auto.connect().await {
|
|
||||||
// Ok(db) => {
|
|
||||||
// let authifier_db = db.clone().to_authifier().await.database;
|
|
||||||
// revolt_database::tasks::start_workers(db, authifier_db);
|
|
||||||
// Ok(())
|
|
||||||
// }
|
|
||||||
// Err(err) => Err(err),
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .or_else(|err| cx.throw_error(err))
|
|
||||||
// .unwrap();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
Ok(cx.undefined())
|
|
||||||
}
|
|
||||||
|
|
||||||
struct DatabaseBinding(Database, Channel);
|
|
||||||
impl Finalize for DatabaseBinding {}
|
|
||||||
impl DatabaseBinding {
|
|
||||||
fn take(&self) -> (Database, Channel) {
|
|
||||||
(self.0.clone(), self.1.clone())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn js_database(mut cx: FunctionContext) -> JsResult<JsBox<DatabaseBinding>> {
|
|
||||||
let db = async_std::task::block_on(DatabaseInfo::Auto.connect())
|
|
||||||
.or_else(|err| cx.throw_error(err))?;
|
|
||||||
|
|
||||||
let channel = cx.channel();
|
|
||||||
Ok(cx.boxed(DatabaseBinding(db, channel)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implementations for models
|
|
||||||
#[derive(Clone)]
|
|
||||||
#[allow(clippy::large_enum_variant)]
|
|
||||||
enum Model {
|
|
||||||
User(revolt_database::User),
|
|
||||||
Error(revolt_result::Error),
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Model {
|
|
||||||
fn give(&self) -> Model {
|
|
||||||
self.clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Finalize for Model {}
|
|
||||||
|
|
||||||
macro_rules! shim_boxed {
|
|
||||||
($cx: ident, $name: ident, $model: ident, $( $variable: ident $type: ident $id: expr )+, $cmd: ident, $( $arg: expr, )+) => {
|
|
||||||
fn $name(mut cx: FunctionContext) -> JsResult<JsPromise> {
|
|
||||||
$(
|
|
||||||
let $variable = cx.argument::<$type>($id)?.value(&mut cx);
|
|
||||||
)+
|
|
||||||
|
|
||||||
let (db, channel) = cx.this::<JsBox<DatabaseBinding>>()?.take();
|
|
||||||
let (deferred, promise) = cx.promise();
|
|
||||||
|
|
||||||
async_std::task::spawn(async move {
|
|
||||||
let result = db.$cmd($($arg,)+).await;
|
|
||||||
deferred.settle_with(&channel, move |mut cx| {
|
|
||||||
Ok(cx.boxed(match result {
|
|
||||||
Ok(value) => Model::$model(value),
|
|
||||||
Err(error) => Model::Error(error)
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(promise)
|
|
||||||
}
|
|
||||||
|
|
||||||
$cx.export_function(stringify!($name), $name)?;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
fn js_data(mut cx: FunctionContext) -> JsResult<JsValue> {
|
|
||||||
match cx.this::<JsBox<Model>>()?.give() {
|
|
||||||
Model::Error(_) => neon_serde4::to_value(&mut cx, &None::<()>),
|
|
||||||
Model::User(user) => neon_serde4::to_value(&mut cx, &user),
|
|
||||||
}
|
|
||||||
.or_else(|e| cx.throw_error(e.to_string()))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn js_error(mut cx: FunctionContext) -> JsResult<JsValue> {
|
|
||||||
let value = match cx.this::<JsBox<Model>>()?.give() {
|
|
||||||
Model::Error(err) => Some(err),
|
|
||||||
_ => None,
|
|
||||||
};
|
|
||||||
|
|
||||||
neon_serde4::to_value(&mut cx, &value).or_else(|e| cx.throw_error(e.to_string()))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Basic data implementation
|
|
||||||
#[derive(Serialize, Deserialize)]
|
|
||||||
struct ResultBinding<T> {
|
|
||||||
#[serde(flatten)]
|
|
||||||
value: Option<T>,
|
|
||||||
error: Option<revolt_result::Error>,
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! shim {
|
|
||||||
($cx: ident, $name: ident, $( $variable: ident $type: ident $id: expr )*, $( $model: ident $modelType: ident $modelId: expr )*, | $db: ident | $closure: expr, $( $arg: expr, )+) => {
|
|
||||||
fn $name(mut cx: FunctionContext) -> JsResult<JsPromise> {
|
|
||||||
$(
|
|
||||||
let $variable = cx.argument::<$type>($id)?.value(&mut cx);
|
|
||||||
)*
|
|
||||||
|
|
||||||
$(
|
|
||||||
let mut $model = if let Model::$modelType(value) = cx.argument::<JsBox<Model>>($modelId)?.give() {
|
|
||||||
value
|
|
||||||
} else {
|
|
||||||
unreachable!()
|
|
||||||
};
|
|
||||||
)*
|
|
||||||
|
|
||||||
let (db, channel) = cx.this::<JsBox<DatabaseBinding>>()?.take();
|
|
||||||
let (deferred, promise) = cx.promise();
|
|
||||||
|
|
||||||
async_std::task::spawn(async move {
|
|
||||||
#[allow(clippy::redundant_closure_call)]
|
|
||||||
let result = (|$db: $crate::Database| $closure)(db.clone()).await;
|
|
||||||
deferred.settle_with(&channel, move |mut cx| {
|
|
||||||
neon_serde4::to_value(
|
|
||||||
&mut cx,
|
|
||||||
&match result {
|
|
||||||
Ok(value) => ResultBinding {
|
|
||||||
value: Some(value),
|
|
||||||
error: None,
|
|
||||||
},
|
|
||||||
Err(error) => ResultBinding {
|
|
||||||
value: None,
|
|
||||||
error: Some(error),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.or_else(|e| cx.throw_error(e.to_string()))
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(promise)
|
|
||||||
}
|
|
||||||
|
|
||||||
$cx.export_function(stringify!($name), $name)?;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[neon::main]
|
|
||||||
fn main(mut cx: ModuleContext) -> NeonResult<()> {
|
|
||||||
// initialise required background stuff
|
|
||||||
cx.export_function("init", js_init)?;
|
|
||||||
|
|
||||||
// database & model stuff
|
|
||||||
cx.export_function("database", js_database)?;
|
|
||||||
cx.export_function("model_data", js_data)?;
|
|
||||||
cx.export_function("model_error", js_error)?;
|
|
||||||
|
|
||||||
shim_boxed!(
|
|
||||||
cx,
|
|
||||||
database_fetch_user,
|
|
||||||
User,
|
|
||||||
user_id JsString 0,
|
|
||||||
fetch_user,
|
|
||||||
&user_id,
|
|
||||||
);
|
|
||||||
|
|
||||||
shim_boxed!(
|
|
||||||
cx,
|
|
||||||
database_fetch_user_by_username,
|
|
||||||
User,
|
|
||||||
username JsString 0
|
|
||||||
discriminator JsString 1,
|
|
||||||
fetch_user_by_username,
|
|
||||||
&username, &discriminator,
|
|
||||||
);
|
|
||||||
|
|
||||||
// procedure calls
|
|
||||||
shim!(
|
|
||||||
cx,
|
|
||||||
proc_channels_create_dm,
|
|
||||||
user_a JsString 0
|
|
||||||
user_b JsString 1,
|
|
||||||
,
|
|
||||||
|db| async move {
|
|
||||||
let user_a = db.fetch_user(&user_a).await?;
|
|
||||||
let user_b = db.fetch_user(&user_b).await?;
|
|
||||||
revolt_database::Channel::create_dm(&db, &user_a, &user_b).await
|
|
||||||
},
|
|
||||||
&userA, &userB,
|
|
||||||
);
|
|
||||||
|
|
||||||
shim!(
|
|
||||||
cx,
|
|
||||||
proc_users_suspend,
|
|
||||||
duration JsNumber 1
|
|
||||||
reason JsString 2,
|
|
||||||
user User 0,
|
|
||||||
|db| async move {
|
|
||||||
let duration = duration as usize;
|
|
||||||
user.suspend(&db, if duration == 0 { None } else { Some(duration) }, Some(reason.split('|').map(|x| x.to_owned()).collect())).await
|
|
||||||
},
|
|
||||||
&user,
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
const Internal = require(".");
|
|
||||||
|
|
||||||
// playing around with class wrapper, not practical
|
|
||||||
class Model {
|
|
||||||
constructor(model) {
|
|
||||||
this.model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return Internal.model_data.bind(this.model)();
|
|
||||||
}
|
|
||||||
|
|
||||||
error() {
|
|
||||||
return Internal.model_error.bind(this.model)();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class User extends Model {
|
|
||||||
constructor(db, user) {
|
|
||||||
super(user);
|
|
||||||
this.db = db;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Database {
|
|
||||||
constructor() {
|
|
||||||
this.db = Internal.database();
|
|
||||||
}
|
|
||||||
|
|
||||||
async fetchUser(userId) {
|
|
||||||
return new User(
|
|
||||||
this,
|
|
||||||
await Internal.database_fetch_user.bind(this.db)(userId)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async fetchUserByUsername(username, discriminator) {
|
|
||||||
return new User(
|
|
||||||
this,
|
|
||||||
await Internal.database_fetch_user_by_username.bind(this.db)(
|
|
||||||
username,
|
|
||||||
discriminator
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const db = new Database();
|
|
||||||
db.fetchUserByUsername("dos", "7624").then((user) => console.info(user.data()));
|
|
||||||
db.fetchUserByUsername("dos", "1111").then((user) => console.info(user.data()));
|
|
||||||
db.fetchUserByUsername("dos", "1111").then((user) =>
|
|
||||||
console.info(user.error())
|
|
||||||
);
|
|
||||||
Generated
-6
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "bindings",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-bonfire"
|
name = "revolt-bonfire"
|
||||||
version = "0.8.2"
|
version = "0.8.8"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
@@ -36,12 +36,12 @@ async-std = { version = "1.8.0", features = [
|
|||||||
] }
|
] }
|
||||||
|
|
||||||
# core
|
# core
|
||||||
authifier = { version = "1.0.9" }
|
authifier = { version = "1.0.15" }
|
||||||
revolt-result = { path = "../core/result" }
|
revolt-result = { path = "../core/result" }
|
||||||
revolt-models = { path = "../core/models" }
|
revolt-models = { path = "../core/models" }
|
||||||
revolt-config = { path = "../core/config" }
|
revolt-config = { path = "../core/config" }
|
||||||
revolt-database = { path = "../core/database" }
|
revolt-database = { path = "../core/database" }
|
||||||
revolt-permissions = { version = "0.8.2", path = "../core/permissions" }
|
revolt-permissions = { version = "0.8.8", path = "../core/permissions" }
|
||||||
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
|
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
|
||||||
|
|
||||||
# redis
|
# redis
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
use futures::future::join_all;
|
||||||
use revolt_database::{
|
use revolt_database::{
|
||||||
events::client::{EventV1, ReadyPayloadFields},
|
events::client::{EventV1, ReadyPayloadFields},
|
||||||
util::permissions::DatabasePermissionQuery,
|
util::permissions::DatabasePermissionQuery,
|
||||||
@@ -99,6 +100,18 @@ impl State {
|
|||||||
let user = self.clone_user();
|
let user = self.clone_user();
|
||||||
self.cache.is_bot = user.bot.is_some();
|
self.cache.is_bot = user.bot.is_some();
|
||||||
|
|
||||||
|
// Fetch pending policy changes.
|
||||||
|
let policy_changes = if user.bot.is_some() {
|
||||||
|
vec![]
|
||||||
|
} else {
|
||||||
|
db.fetch_policy_changes()
|
||||||
|
.await?
|
||||||
|
.into_iter()
|
||||||
|
.filter(|policy| policy.created_time > user.last_acknowledged_policy_change)
|
||||||
|
.map(Into::into)
|
||||||
|
.collect()
|
||||||
|
};
|
||||||
|
|
||||||
// Find all relationships to the user.
|
// Find all relationships to the user.
|
||||||
let mut user_ids: HashSet<String> = user
|
let mut user_ids: HashSet<String> = user
|
||||||
.relations
|
.relations
|
||||||
@@ -174,7 +187,7 @@ impl State {
|
|||||||
.iter()
|
.iter()
|
||||||
.find(|e| matches!(e, ReadyPayloadFields::UserSettings(_)))
|
.find(|e| matches!(e, ReadyPayloadFields::UserSettings(_)))
|
||||||
{
|
{
|
||||||
Some(db.fetch_user_settings(&user.id, &keys).await?)
|
Some(db.fetch_user_settings(&user.id, keys).await?)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
@@ -198,13 +211,11 @@ impl State {
|
|||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Make all users appear from our perspective.
|
// Make all users appear from our perspective.
|
||||||
let mut users: Vec<v0::User> = users
|
let mut users: Vec<v0::User> = join_all(users.into_iter().map(|other_user| async {
|
||||||
.into_iter()
|
let is_online = online_ids.contains(&other_user.id);
|
||||||
.map(|other_user| {
|
other_user.into_known(&user, is_online).await
|
||||||
let is_online = online_ids.contains(&other_user.id);
|
}))
|
||||||
other_user.into_known(&user, is_online)
|
.await;
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
// Make sure we see our own user correctly.
|
// Make sure we see our own user correctly.
|
||||||
users.push(user.into_self(true).await);
|
users.push(user.into_self(true).await);
|
||||||
@@ -228,6 +239,7 @@ impl State {
|
|||||||
for channel in &channels {
|
for channel in &channels {
|
||||||
self.insert_subscription(channel.id().to_string()).await;
|
self.insert_subscription(channel.id().to_string()).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(EventV1::Ready {
|
Ok(EventV1::Ready {
|
||||||
users: if fields.contains(&ReadyPayloadFields::Users) {
|
users: if fields.contains(&ReadyPayloadFields::Users) {
|
||||||
Some(users)
|
Some(users)
|
||||||
@@ -253,6 +265,8 @@ impl State {
|
|||||||
|
|
||||||
user_settings,
|
user_settings,
|
||||||
channel_unreads: channel_unreads.map(|vec| vec.into_iter().map(Into::into).collect()),
|
channel_unreads: channel_unreads.map(|vec| vec.into_iter().map(Into::into).collect()),
|
||||||
|
|
||||||
|
policy_changes,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::{collections::HashSet, net::SocketAddr, sync::Arc};
|
|||||||
use async_tungstenite::WebSocketStream;
|
use async_tungstenite::WebSocketStream;
|
||||||
use authifier::AuthifierEvent;
|
use authifier::AuthifierEvent;
|
||||||
use fred::{
|
use fred::{
|
||||||
error::{RedisError, RedisErrorKind},
|
error::RedisErrorKind,
|
||||||
interfaces::{ClientLike, EventInterface, PubsubInterface},
|
interfaces::{ClientLike, EventInterface, PubsubInterface},
|
||||||
types::RedisConfig,
|
types::RedisConfig,
|
||||||
};
|
};
|
||||||
@@ -17,6 +17,7 @@ use redis_kiss::{PayloadType, REDIS_PAYLOAD_TYPE, REDIS_URI};
|
|||||||
use revolt_config::report_internal_error;
|
use revolt_config::report_internal_error;
|
||||||
use revolt_database::{
|
use revolt_database::{
|
||||||
events::{client::EventV1, server::ClientMessage},
|
events::{client::EventV1, server::ClientMessage},
|
||||||
|
iso8601_timestamp::Timestamp,
|
||||||
Database, User, UserHint,
|
Database, User, UserHint,
|
||||||
};
|
};
|
||||||
use revolt_presence::{create_session, delete_session};
|
use revolt_presence::{create_session, delete_session};
|
||||||
@@ -100,6 +101,10 @@ pub async fn client(db: &'static Database, stream: TcpStream, addr: SocketAddr)
|
|||||||
|
|
||||||
info!("User {addr:?} authenticated as @{}", user.username);
|
info!("User {addr:?} authenticated as @{}", user.username);
|
||||||
|
|
||||||
|
db.update_session_last_seen(&session_id, Timestamp::now_utc())
|
||||||
|
.await
|
||||||
|
.ok();
|
||||||
|
|
||||||
// Create local state.
|
// Create local state.
|
||||||
let mut state = State::from(user, session_id);
|
let mut state = State::from(user, session_id);
|
||||||
let user_id = state.cache.user_id.clone();
|
let user_id = state.cache.user_id.clone();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-config"
|
name = "revolt-config"
|
||||||
version = "0.8.2"
|
version = "0.8.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
@@ -9,9 +9,10 @@ description = "Revolt Backend: Configuration"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
anyhow = ["dep:sentry-anyhow"]
|
||||||
report-macros = ["revolt-result"]
|
report-macros = ["revolt-result"]
|
||||||
test = ["async-std"]
|
test = ["async-std"]
|
||||||
default = ["test"]
|
default = ["test", "anyhow"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Utility
|
# Utility
|
||||||
@@ -32,6 +33,7 @@ pretty_env_logger = "0.4.0"
|
|||||||
|
|
||||||
# Sentry
|
# Sentry
|
||||||
sentry = "0.31.5"
|
sentry = "0.31.5"
|
||||||
|
sentry-anyhow = { version = "0.38.1", optional = true }
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
revolt-result = { version = "0.8.2", path = "../result", optional = true }
|
revolt-result = { version = "0.8.8", path = "../result", optional = true }
|
||||||
|
|||||||
@@ -7,3 +7,6 @@ host = "127.0.0.1"
|
|||||||
port = 5672
|
port = 5672
|
||||||
username = "rabbituser"
|
username = "rabbituser"
|
||||||
password = "rabbitpass"
|
password = "rabbitpass"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
webhooks_enabled = true
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
production = false
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
# MongoDB connection URL
|
# MongoDB connection URL
|
||||||
# Defaults to the container name specified in self-hosted
|
# Defaults to the container name specified in self-hosted
|
||||||
@@ -52,6 +54,8 @@ authifier_shield_key = ""
|
|||||||
voso_legacy_token = ""
|
voso_legacy_token = ""
|
||||||
# Whether services are behind the Cloudflare network
|
# Whether services are behind the Cloudflare network
|
||||||
trust_cloudflare = false
|
trust_cloudflare = false
|
||||||
|
# easypwned endpoint
|
||||||
|
easypwned = ""
|
||||||
|
|
||||||
[api.security.captcha]
|
[api.security.captcha]
|
||||||
# hCaptcha configuration
|
# hCaptcha configuration
|
||||||
@@ -62,19 +66,28 @@ hcaptcha_sitekey = ""
|
|||||||
# Maximum concurrent connections (to proxy server)
|
# Maximum concurrent connections (to proxy server)
|
||||||
max_concurrent_connections = 50
|
max_concurrent_connections = 50
|
||||||
|
|
||||||
|
[api.users]
|
||||||
|
|
||||||
|
|
||||||
[pushd]
|
[pushd]
|
||||||
# this changes the names of the queues to not overlap
|
# this changes the names of the queues to not overlap
|
||||||
# prod/beta if they happen to be on the same exchange/instance.
|
# prod/beta if they happen to be on the same exchange/instance.
|
||||||
# Usually they have to be, so that messages sent from one or the other get sent to everyone
|
# Usually they have to be, so that messages sent from one or the other get sent to everyone
|
||||||
production = true
|
production = true
|
||||||
|
|
||||||
|
# Changes how many users are processed in each chunk when resolving role/everyone mentions.
|
||||||
|
# Increasing this will resolve mentions faster, but will consume more memory while resolving.
|
||||||
|
mass_mention_chunk_size = 200
|
||||||
|
|
||||||
# none of these should need changing
|
# none of these should need changing
|
||||||
exchange = "revolt.notifications"
|
exchange = "revolt.notifications"
|
||||||
message_queue = "notifications.origin.message"
|
message_queue = "notifications.origin.message"
|
||||||
fr_accepted_queue = "notifications.ingest.fr_accepted" # friend request accepted
|
mass_mention_queue = "notifications.origin.mass_mention" # handles messages that contain role or everyone mentions
|
||||||
fr_received_queue = "notifications.ingest.fr_received" # friend request received
|
fr_accepted_queue = "notifications.ingest.fr_accepted" # friend request accepted
|
||||||
generic_queue = "notifications.ingest.generic" # generic messages (title + body)
|
fr_received_queue = "notifications.ingest.fr_received" # friend request received
|
||||||
ack_queue = "notifications.process.ack" # updates badges for apple devices
|
generic_queue = "notifications.ingest.generic" # generic messages (title + body)
|
||||||
|
ack_queue = "notifications.process.ack" # updates badges for apple devices
|
||||||
|
|
||||||
|
|
||||||
[pushd.vapid]
|
[pushd.vapid]
|
||||||
queue = "notifications.outbound.vapid"
|
queue = "notifications.outbound.vapid"
|
||||||
@@ -171,9 +184,13 @@ default_bucket = "revolt-uploads"
|
|||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# Bucket to upload to by default
|
|
||||||
# Feature gate options
|
# Feature gate options
|
||||||
webhooks_enabled = false
|
webhooks_enabled = false
|
||||||
|
# Enable push notifications for mass pings (everyone, online, roles)
|
||||||
|
# When false this will still ping in-client but will not send notifications from pushd
|
||||||
|
mass_mentions_send_notifications = true
|
||||||
|
# Can role/everyone pings be used at all
|
||||||
|
mass_mentions_enabled = true
|
||||||
|
|
||||||
[features.limits]
|
[features.limits]
|
||||||
|
|
||||||
@@ -258,4 +275,5 @@ api = ""
|
|||||||
events = ""
|
events = ""
|
||||||
files = ""
|
files = ""
|
||||||
proxy = ""
|
proxy = ""
|
||||||
|
pushd = ""
|
||||||
crond = ""
|
crond = ""
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use once_cell::sync::Lazy;
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
pub use sentry::{capture_error, capture_message, Level};
|
pub use sentry::{capture_error, capture_message, Level};
|
||||||
|
pub use sentry_anyhow::capture_anyhow;
|
||||||
|
|
||||||
#[cfg(feature = "report-macros")]
|
#[cfg(feature = "report-macros")]
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
@@ -59,6 +60,9 @@ static CONFIG_SEARCH_PATHS: [&str; 3] = [
|
|||||||
"/Revolt.toml",
|
"/Revolt.toml",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/// Path to search for test overrides
|
||||||
|
static TEST_OVERRIDE_PATH: &str = "Revolt.test-overrides.toml";
|
||||||
|
|
||||||
/// Configuration builder
|
/// Configuration builder
|
||||||
static CONFIG_BUILDER: Lazy<RwLock<Config>> = Lazy::new(|| {
|
static CONFIG_BUILDER: Lazy<RwLock<Config>> = Lazy::new(|| {
|
||||||
RwLock::new({
|
RwLock::new({
|
||||||
@@ -72,6 +76,20 @@ static CONFIG_BUILDER: Lazy<RwLock<Config>> = Lazy::new(|| {
|
|||||||
include_str!("../Revolt.test.toml"),
|
include_str!("../Revolt.test.toml"),
|
||||||
FileFormat::Toml,
|
FileFormat::Toml,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// recursively search upwards for an overrides file (if there is one)
|
||||||
|
if let Ok(cwd) = std::env::current_dir() {
|
||||||
|
let mut path = Some(cwd.as_path());
|
||||||
|
while let Some(current_path) = path {
|
||||||
|
let target_path = current_path.join(TEST_OVERRIDE_PATH);
|
||||||
|
if target_path.exists() {
|
||||||
|
builder = builder
|
||||||
|
.add_source(File::new(target_path.to_str().unwrap(), FileFormat::Toml));
|
||||||
|
}
|
||||||
|
|
||||||
|
path = current_path.parent();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for path in CONFIG_SEARCH_PATHS {
|
for path in CONFIG_SEARCH_PATHS {
|
||||||
@@ -123,6 +141,7 @@ pub struct ApiSmtp {
|
|||||||
pub reply_to: Option<String>,
|
pub reply_to: Option<String>,
|
||||||
pub port: Option<i32>,
|
pub port: Option<i32>,
|
||||||
pub use_tls: Option<bool>,
|
pub use_tls: Option<bool>,
|
||||||
|
pub use_starttls: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
@@ -168,6 +187,7 @@ pub struct ApiSecurity {
|
|||||||
pub voso_legacy_token: String,
|
pub voso_legacy_token: String,
|
||||||
pub captcha: ApiSecurityCaptcha,
|
pub captcha: ApiSecurityCaptcha,
|
||||||
pub trust_cloudflare: bool,
|
pub trust_cloudflare: bool,
|
||||||
|
pub easypwned: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
@@ -175,19 +195,29 @@ pub struct ApiWorkers {
|
|||||||
pub max_concurrent_connections: usize,
|
pub max_concurrent_connections: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
|
pub struct ApiUsers {
|
||||||
|
pub early_adopter_cutoff: Option<u64>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct Api {
|
pub struct Api {
|
||||||
pub registration: ApiRegistration,
|
pub registration: ApiRegistration,
|
||||||
pub smtp: ApiSmtp,
|
pub smtp: ApiSmtp,
|
||||||
pub security: ApiSecurity,
|
pub security: ApiSecurity,
|
||||||
pub workers: ApiWorkers,
|
pub workers: ApiWorkers,
|
||||||
|
pub users: ApiUsers,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Debug, Clone)]
|
#[derive(Deserialize, Debug, Clone)]
|
||||||
pub struct Pushd {
|
pub struct Pushd {
|
||||||
pub production: bool,
|
pub production: bool,
|
||||||
pub exchange: String,
|
pub exchange: String,
|
||||||
|
pub mass_mention_chunk_size: usize,
|
||||||
|
|
||||||
|
// Queues
|
||||||
pub message_queue: String,
|
pub message_queue: String,
|
||||||
|
pub mass_mention_queue: String,
|
||||||
pub fr_accepted_queue: String,
|
pub fr_accepted_queue: String,
|
||||||
pub fr_received_queue: String,
|
pub fr_received_queue: String,
|
||||||
pub generic_queue: String,
|
pub generic_queue: String,
|
||||||
@@ -214,6 +244,10 @@ impl Pushd {
|
|||||||
self.get_routing_key(self.message_queue.clone())
|
self.get_routing_key(self.message_queue.clone())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_mass_mention_routing_key(&self) -> String {
|
||||||
|
self.get_routing_key(self.mass_mention_queue.clone())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_fr_accepted_routing_key(&self) -> String {
|
pub fn get_fr_accepted_routing_key(&self) -> String {
|
||||||
self.get_routing_key(self.fr_accepted_queue.clone())
|
self.get_routing_key(self.fr_accepted_queue.clone())
|
||||||
}
|
}
|
||||||
@@ -314,6 +348,9 @@ impl Default for FeaturesAdvanced {
|
|||||||
pub struct Features {
|
pub struct Features {
|
||||||
pub limits: FeaturesLimitsCollection,
|
pub limits: FeaturesLimitsCollection,
|
||||||
pub webhooks_enabled: bool,
|
pub webhooks_enabled: bool,
|
||||||
|
pub mass_mentions_send_notifications: bool,
|
||||||
|
pub mass_mentions_enabled: bool,
|
||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub advanced: FeaturesAdvanced,
|
pub advanced: FeaturesAdvanced,
|
||||||
}
|
}
|
||||||
@@ -324,6 +361,7 @@ pub struct Sentry {
|
|||||||
pub events: String,
|
pub events: String,
|
||||||
pub files: String,
|
pub files: String,
|
||||||
pub proxy: String,
|
pub proxy: String,
|
||||||
|
pub pushd: String,
|
||||||
pub crond: String,
|
pub crond: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,6 +375,7 @@ pub struct Settings {
|
|||||||
pub files: Files,
|
pub files: Files,
|
||||||
pub features: Features,
|
pub features: Features,
|
||||||
pub sentry: Sentry,
|
pub sentry: Sentry,
|
||||||
|
pub production: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Settings {
|
impl Settings {
|
||||||
@@ -364,7 +403,19 @@ pub async fn read() -> Config {
|
|||||||
|
|
||||||
#[cached(time = 30)]
|
#[cached(time = 30)]
|
||||||
pub async fn config() -> Settings {
|
pub async fn config() -> Settings {
|
||||||
read().await.try_deserialize::<Settings>().unwrap()
|
let mut config = read().await.try_deserialize::<Settings>().unwrap();
|
||||||
|
|
||||||
|
// inject REDIS_URI for redis-kiss library
|
||||||
|
if std::env::var("REDIS_URL").is_err() {
|
||||||
|
std::env::set_var("REDIS_URI", config.database.redis.clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
// auto-detect production nodes
|
||||||
|
if config.hosts.api.contains("https") && config.hosts.api.contains("revolt.chat") {
|
||||||
|
config.production = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
config
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Configure logging and common Rust variables
|
/// Configure logging and common Rust variables
|
||||||
@@ -377,12 +428,6 @@ pub async fn setup_logging(release: &'static str, dsn: String) -> Option<sentry:
|
|||||||
std::env::set_var("ROCKET_ADDRESS", "0.0.0.0");
|
std::env::set_var("ROCKET_ADDRESS", "0.0.0.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if std::env::var("REDIS_URL").is_err() {
|
|
||||||
// Configure redis-kiss library
|
|
||||||
let config = config().await;
|
|
||||||
std::env::set_var("REDIS_URI", config.database.redis);
|
|
||||||
}
|
|
||||||
|
|
||||||
pretty_env_logger::init();
|
pretty_env_logger::init();
|
||||||
log::info!("Starting {release}");
|
log::info!("Starting {release}");
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revolt-database"
|
name = "revolt-database"
|
||||||
version = "0.8.2"
|
version = "0.8.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
authors = ["Paul Makles <me@insrt.uk>"]
|
authors = ["Paul Makles <me@insrt.uk>"]
|
||||||
@@ -24,18 +24,19 @@ default = ["mongodb", "async-std-runtime", "tasks"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core
|
# Core
|
||||||
revolt-config = { version = "0.8.2", path = "../config", features = [
|
revolt-config = { version = "0.8.8", path = "../config", features = [
|
||||||
"report-macros",
|
"report-macros",
|
||||||
] }
|
] }
|
||||||
revolt-result = { version = "0.8.2", path = "../result" }
|
revolt-result = { version = "0.8.8", path = "../result" }
|
||||||
revolt-models = { version = "0.8.2", path = "../models", features = [
|
revolt-models = { version = "0.8.8", path = "../models", features = [
|
||||||
"validator",
|
"validator",
|
||||||
] }
|
] }
|
||||||
revolt-presence = { version = "0.8.2", path = "../presence" }
|
revolt-presence = { version = "0.8.8", path = "../presence" }
|
||||||
revolt-permissions = { version = "0.8.2", path = "../permissions", features = [
|
revolt-permissions = { version = "0.8.8", path = "../permissions", features = [
|
||||||
"serde",
|
"serde",
|
||||||
"bson",
|
"bson",
|
||||||
] }
|
] }
|
||||||
|
revolt-parser = { version = "0.8.8", path = "../parser" }
|
||||||
|
|
||||||
# Utility
|
# Utility
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
@@ -64,7 +65,7 @@ redis-kiss = { version = "0.1.4" }
|
|||||||
|
|
||||||
# Database
|
# Database
|
||||||
bson = { optional = true, version = "2.1.0" }
|
bson = { optional = true, version = "2.1.0" }
|
||||||
mongodb = { optional = true, version = "2.1.0", default-features = false }
|
mongodb = { optional = true, version = "3.1.0" }
|
||||||
|
|
||||||
# Database Migration
|
# Database Migration
|
||||||
unicode-segmentation = "1.10.1"
|
unicode-segmentation = "1.10.1"
|
||||||
@@ -96,7 +97,7 @@ web-push = "0.10.0"
|
|||||||
revolt_a2 = { version = "0.10", default-features = false, features = ["ring"] }
|
revolt_a2 = { version = "0.10", default-features = false, features = ["ring"] }
|
||||||
|
|
||||||
# Authifier
|
# Authifier
|
||||||
authifier = { version = "1.0.9", features = ["rocket_impl"] }
|
authifier = { version = "1.0.15", features = ["rocket_impl"] }
|
||||||
|
|
||||||
# RabbitMQ
|
# RabbitMQ
|
||||||
amqprs = { version = "1.7.0" }
|
amqprs = { version = "1.7.0" }
|
||||||
|
|||||||
@@ -3,18 +3,21 @@
|
|||||||
"_object_type": "User",
|
"_object_type": "User",
|
||||||
"_id": "__ID:0__",
|
"_id": "__ID:0__",
|
||||||
"username": "Owner",
|
"username": "Owner",
|
||||||
|
"last_acknowledged_policy_change": "2025-06-07T04:04:48+0000",
|
||||||
"discriminator": "0001"
|
"discriminator": "0001"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_object_type": "User",
|
"_object_type": "User",
|
||||||
"_id": "__ID:1__",
|
"_id": "__ID:1__",
|
||||||
"username": "Member",
|
"username": "Member",
|
||||||
|
"last_acknowledged_policy_change": "2025-06-07T04:04:48+0000",
|
||||||
"discriminator": "0001"
|
"discriminator": "0001"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_object_type": "User",
|
"_object_type": "User",
|
||||||
"_id": "__ID:2__",
|
"_id": "__ID:2__",
|
||||||
"username": "Member",
|
"username": "Member",
|
||||||
|
"last_acknowledged_policy_change": "2025-06-07T04:04:48+0000",
|
||||||
"discriminator": "0002"
|
"discriminator": "0002"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -23,6 +26,9 @@
|
|||||||
"channel_type": "Group",
|
"channel_type": "Group",
|
||||||
"name": "My Group",
|
"name": "My Group",
|
||||||
"owner": "__ID:0__",
|
"owner": "__ID:0__",
|
||||||
"recipients": ["__ID:0__", "__ID:1__"]
|
"recipients": [
|
||||||
|
"__ID:0__",
|
||||||
|
"__ID:1__"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -3,18 +3,21 @@
|
|||||||
"_object_type": "User",
|
"_object_type": "User",
|
||||||
"_id": "__ID:0__",
|
"_id": "__ID:0__",
|
||||||
"username": "Owner",
|
"username": "Owner",
|
||||||
|
"last_acknowledged_policy_change": "2025-06-07T04:04:48+0000",
|
||||||
"discriminator": "0001"
|
"discriminator": "0001"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_object_type": "User",
|
"_object_type": "User",
|
||||||
"_id": "__ID:1__",
|
"_id": "__ID:1__",
|
||||||
"username": "Moderator",
|
"username": "Moderator",
|
||||||
|
"last_acknowledged_policy_change": "2025-06-07T04:04:48+0000",
|
||||||
"discriminator": "0001"
|
"discriminator": "0001"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"_object_type": "User",
|
"_object_type": "User",
|
||||||
"_id": "__ID:2__",
|
"_id": "__ID:2__",
|
||||||
"username": "User",
|
"username": "User",
|
||||||
|
"last_acknowledged_policy_change": "2025-06-07T04:04:48+0000",
|
||||||
"discriminator": "0001"
|
"discriminator": "0001"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -39,7 +42,9 @@
|
|||||||
"_id": "__ID:4__",
|
"_id": "__ID:4__",
|
||||||
"owner": "__ID:0__",
|
"owner": "__ID:0__",
|
||||||
"name": "Server",
|
"name": "Server",
|
||||||
"channels": ["__ID:3__"],
|
"channels": [
|
||||||
|
"__ID:3__"
|
||||||
|
],
|
||||||
"roles": {
|
"roles": {
|
||||||
"__ID:5__": {
|
"__ID:5__": {
|
||||||
"name": "Moderator",
|
"name": "Moderator",
|
||||||
@@ -47,7 +52,7 @@
|
|||||||
"a": 545270208,
|
"a": 545270208,
|
||||||
"d": 0
|
"d": 0
|
||||||
},
|
},
|
||||||
"rank": 3
|
"rank": 1
|
||||||
},
|
},
|
||||||
"__ID:6__": {
|
"__ID:6__": {
|
||||||
"name": "Owner",
|
"name": "Owner",
|
||||||
@@ -66,7 +71,9 @@
|
|||||||
"user": "__ID:0__",
|
"user": "__ID:0__",
|
||||||
"server": "__ID:4__"
|
"server": "__ID:4__"
|
||||||
},
|
},
|
||||||
"roles": ["__ID:6__"],
|
"roles": [
|
||||||
|
"__ID:6__"
|
||||||
|
],
|
||||||
"joined_at": 1698318340195
|
"joined_at": 1698318340195
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -75,7 +82,9 @@
|
|||||||
"user": "__ID:1__",
|
"user": "__ID:1__",
|
||||||
"server": "__ID:4__"
|
"server": "__ID:4__"
|
||||||
},
|
},
|
||||||
"roles": ["__ID:5__"],
|
"roles": [
|
||||||
|
"__ID:5__"
|
||||||
|
],
|
||||||
"joined_at": 1698318340195
|
"joined_at": 1698318340195
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -86,4 +95,4 @@
|
|||||||
},
|
},
|
||||||
"joined_at": 1698318340195
|
"joined_at": 1698318340195
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -170,6 +170,38 @@ impl AMQP {
|
|||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn mass_mention_message_sent(
|
||||||
|
&self,
|
||||||
|
server_id: String,
|
||||||
|
payload: Vec<PushNotification>,
|
||||||
|
) -> Result<(), AMQPError> {
|
||||||
|
let config = revolt_config::config().await;
|
||||||
|
|
||||||
|
let payload = MassMessageSentPayload {
|
||||||
|
notifications: payload,
|
||||||
|
server_id,
|
||||||
|
};
|
||||||
|
let payload = to_string(&payload).unwrap();
|
||||||
|
|
||||||
|
let routing_key = config.pushd.get_mass_mention_routing_key();
|
||||||
|
|
||||||
|
debug!(
|
||||||
|
"Sending mass mention payload on channel {}: {}",
|
||||||
|
routing_key, payload
|
||||||
|
);
|
||||||
|
|
||||||
|
self.channel
|
||||||
|
.basic_publish(
|
||||||
|
BasicProperties::default()
|
||||||
|
.with_content_type("application/json")
|
||||||
|
.with_persistence(true)
|
||||||
|
.finish(),
|
||||||
|
payload.into(),
|
||||||
|
BasicPublishArguments::new(&config.pushd.exchange, routing_key.as_str()),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn ack_message(
|
pub async fn ack_message(
|
||||||
&self,
|
&self,
|
||||||
user_id: String,
|
user_id: String,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ mod reference;
|
|||||||
|
|
||||||
use authifier::config::Captcha;
|
use authifier::config::Captcha;
|
||||||
use authifier::config::EmailVerificationConfig;
|
use authifier::config::EmailVerificationConfig;
|
||||||
|
use authifier::config::PasswordScanning;
|
||||||
use authifier::config::ResolveIp;
|
use authifier::config::ResolveIp;
|
||||||
use authifier::config::SMTPSettings;
|
use authifier::config::SMTPSettings;
|
||||||
use authifier::config::Shield;
|
use authifier::config::Shield;
|
||||||
@@ -102,6 +103,13 @@ impl Database {
|
|||||||
let config = config().await;
|
let config = config().await;
|
||||||
|
|
||||||
let mut auth_config = authifier::Config {
|
let mut auth_config = authifier::Config {
|
||||||
|
password_scanning: if config.api.security.easypwned.is_empty() {
|
||||||
|
Default::default()
|
||||||
|
} else {
|
||||||
|
PasswordScanning::EasyPwned {
|
||||||
|
endpoint: config.api.security.easypwned,
|
||||||
|
}
|
||||||
|
},
|
||||||
email_verification: if !config.api.smtp.host.is_empty() {
|
email_verification: if !config.api.smtp.host.is_empty() {
|
||||||
EmailVerificationConfig::Enabled {
|
EmailVerificationConfig::Enabled {
|
||||||
smtp: SMTPSettings {
|
smtp: SMTPSettings {
|
||||||
@@ -118,28 +126,69 @@ impl Database {
|
|||||||
),
|
),
|
||||||
port: config.api.smtp.port,
|
port: config.api.smtp.port,
|
||||||
use_tls: config.api.smtp.use_tls,
|
use_tls: config.api.smtp.use_tls,
|
||||||
|
use_starttls: config.api.smtp.use_starttls,
|
||||||
},
|
},
|
||||||
expiry: Default::default(),
|
expiry: Default::default(),
|
||||||
templates: Templates {
|
templates: if config.production {
|
||||||
verify: Template {
|
Templates {
|
||||||
title: "Verify your Revolt account.".into(),
|
verify: Template {
|
||||||
text: include_str!("../../templates/verify.txt").into(),
|
title: "Verify your Revolt account.".into(),
|
||||||
url: format!("{}/login/verify/", config.hosts.app),
|
text: include_str!("../../templates/verify.txt").into(),
|
||||||
html: Some(include_str!("../../templates/verify.html").into()),
|
url: format!("{}/login/verify/", config.hosts.app),
|
||||||
},
|
html: Some(include_str!("../../templates/verify.html").into()),
|
||||||
reset: Template {
|
},
|
||||||
title: "Reset your Revolt password.".into(),
|
reset: Template {
|
||||||
text: include_str!("../../templates/reset.txt").into(),
|
title: "Reset your Revolt password.".into(),
|
||||||
url: format!("{}/login/reset/", config.hosts.app),
|
text: include_str!("../../templates/reset.txt").into(),
|
||||||
html: Some(include_str!("../../templates/reset.html").into()),
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
},
|
html: Some(include_str!("../../templates/reset.html").into()),
|
||||||
deletion: Template {
|
},
|
||||||
title: "Confirm account deletion.".into(),
|
reset_existing: Template {
|
||||||
text: include_str!("../../templates/deletion.txt").into(),
|
title: "You already have a Revolt account, reset your password."
|
||||||
url: format!("{}/delete/", config.hosts.app),
|
.into(),
|
||||||
html: Some(include_str!("../../templates/deletion.html").into()),
|
text: include_str!("../../templates/reset-existing.txt").into(),
|
||||||
},
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
welcome: None,
|
html: Some(
|
||||||
|
include_str!("../../templates/reset-existing.html").into(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
deletion: Template {
|
||||||
|
title: "Confirm account deletion.".into(),
|
||||||
|
text: include_str!("../../templates/deletion.txt").into(),
|
||||||
|
url: format!("{}/delete/", config.hosts.app),
|
||||||
|
html: Some(include_str!("../../templates/deletion.html").into()),
|
||||||
|
},
|
||||||
|
welcome: None,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Templates {
|
||||||
|
verify: Template {
|
||||||
|
title: "Verify your account.".into(),
|
||||||
|
text: include_str!("../../templates/verify.whitelabel.txt").into(),
|
||||||
|
url: format!("{}/login/verify/", config.hosts.app),
|
||||||
|
html: None,
|
||||||
|
},
|
||||||
|
reset: Template {
|
||||||
|
title: "Reset your password.".into(),
|
||||||
|
text: include_str!("../../templates/reset.whitelabel.txt").into(),
|
||||||
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
|
html: None,
|
||||||
|
},
|
||||||
|
reset_existing: Template {
|
||||||
|
title: "Reset your password.".into(),
|
||||||
|
text: include_str!("../../templates/reset.whitelabel.txt").into(),
|
||||||
|
url: format!("{}/login/reset/", config.hosts.app),
|
||||||
|
html: None,
|
||||||
|
},
|
||||||
|
deletion: Template {
|
||||||
|
title: "Confirm account deletion.".into(),
|
||||||
|
text: include_str!("../../templates/deletion.whitelabel.txt")
|
||||||
|
.into(),
|
||||||
|
url: format!("{}/delete/", config.hosts.app),
|
||||||
|
html: None,
|
||||||
|
},
|
||||||
|
welcome: None,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -31,17 +31,17 @@ impl MongoDb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get a collection by its name
|
/// Get a collection by its name
|
||||||
pub fn col<T>(&self, collection: &str) -> mongodb::Collection<T> {
|
pub fn col<T: Send + Sync>(&self, collection: &str) -> mongodb::Collection<T> {
|
||||||
self.db().collection(collection)
|
self.db().collection(collection)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Insert one document into a collection
|
/// Insert one document into a collection
|
||||||
pub async fn insert_one<T: Serialize>(
|
pub async fn insert_one<T: Serialize + Send + Sync>(
|
||||||
&self,
|
&self,
|
||||||
collection: &'static str,
|
collection: &'static str,
|
||||||
document: T,
|
document: T,
|
||||||
) -> Result<InsertOneResult> {
|
) -> Result<InsertOneResult> {
|
||||||
self.col::<T>(collection).insert_one(document, None).await
|
self.col::<T>(collection).insert_one(document).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Count documents by projection
|
/// Count documents by projection
|
||||||
@@ -51,7 +51,7 @@ impl MongoDb {
|
|||||||
projection: Document,
|
projection: Document,
|
||||||
) -> Result<u64> {
|
) -> Result<u64> {
|
||||||
self.col::<Document>(collection)
|
self.col::<Document>(collection)
|
||||||
.count_documents(projection, None)
|
.count_documents(projection)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,7 +67,8 @@ impl MongoDb {
|
|||||||
{
|
{
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<T>(collection)
|
.col::<T>(collection)
|
||||||
.find(projection, options)
|
.find(projection)
|
||||||
|
.with_options(options)
|
||||||
.await?
|
.await?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
if cfg!(debug_assertions) {
|
if cfg!(debug_assertions) {
|
||||||
@@ -101,7 +102,8 @@ impl MongoDb {
|
|||||||
O: Into<Option<FindOneOptions>>,
|
O: Into<Option<FindOneOptions>>,
|
||||||
{
|
{
|
||||||
self.col::<T>(collection)
|
self.col::<T>(collection)
|
||||||
.find_one(projection, options)
|
.find_one(projection)
|
||||||
|
.with_options(options)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +167,7 @@ impl MongoDb {
|
|||||||
};
|
};
|
||||||
|
|
||||||
self.col::<Document>(collection)
|
self.col::<Document>(collection)
|
||||||
.update_one(projection, query, None)
|
.update_one(projection, query)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +202,7 @@ impl MongoDb {
|
|||||||
projection: Document,
|
projection: Document,
|
||||||
) -> Result<DeleteResult> {
|
) -> Result<DeleteResult> {
|
||||||
self.col::<Document>(collection)
|
self.col::<Document>(collection)
|
||||||
.delete_one(projection, None)
|
.delete_one(projection)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ use futures::lock::Mutex;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
Bot, Channel, ChannelCompositeKey, ChannelUnread, Emoji, File, FileHash, Invite, Member,
|
Bot, Channel, ChannelCompositeKey, ChannelUnread, Emoji, File, FileHash, Invite, Member,
|
||||||
MemberCompositeKey, Message, RatelimitEvent, Report, Server, ServerBan, Snapshot, User,
|
MemberCompositeKey, Message, PolicyChange, RatelimitEvent, Report, Server, ServerBan, Snapshot,
|
||||||
UserSettings, Webhook,
|
User, UserSettings, Webhook,
|
||||||
};
|
};
|
||||||
|
|
||||||
database_derived!(
|
database_derived!(
|
||||||
@@ -21,6 +21,7 @@ database_derived!(
|
|||||||
pub file_hashes: Arc<Mutex<HashMap<String, FileHash>>>,
|
pub file_hashes: Arc<Mutex<HashMap<String, FileHash>>>,
|
||||||
pub files: Arc<Mutex<HashMap<String, File>>>,
|
pub files: Arc<Mutex<HashMap<String, File>>>,
|
||||||
pub messages: Arc<Mutex<HashMap<String, Message>>>,
|
pub messages: Arc<Mutex<HashMap<String, Message>>>,
|
||||||
|
pub policy_changes: Arc<Mutex<HashMap<String, PolicyChange>>>,
|
||||||
pub ratelimit_events: Arc<Mutex<HashMap<String, RatelimitEvent>>>,
|
pub ratelimit_events: Arc<Mutex<HashMap<String, RatelimitEvent>>>,
|
||||||
pub user_settings: Arc<Mutex<HashMap<String, UserSettings>>>,
|
pub user_settings: Arc<Mutex<HashMap<String, UserSettings>>>,
|
||||||
pub users: Arc<Mutex<HashMap<String, User>>>,
|
pub users: Arc<Mutex<HashMap<String, User>>>,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use revolt_models::v0::{
|
|||||||
AppendMessage, Channel, ChannelUnread, Emoji, FieldsChannel, FieldsMember, FieldsMessage,
|
AppendMessage, Channel, ChannelUnread, Emoji, FieldsChannel, FieldsMember, FieldsMessage,
|
||||||
FieldsRole, FieldsServer, FieldsUser, FieldsWebhook, Member, MemberCompositeKey, Message,
|
FieldsRole, FieldsServer, FieldsUser, FieldsWebhook, Member, MemberCompositeKey, Message,
|
||||||
PartialChannel, PartialMember, PartialMessage, PartialRole, PartialServer, PartialUser,
|
PartialChannel, PartialMember, PartialMessage, PartialRole, PartialServer, PartialUser,
|
||||||
PartialWebhook, RemovalIntention, Report, Server, User, UserSettings, Webhook,
|
PartialWebhook, PolicyChange, RemovalIntention, Report, Server, User, UserSettings, Webhook,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::Database;
|
use crate::Database;
|
||||||
@@ -62,6 +62,8 @@ pub enum EventV1 {
|
|||||||
user_settings: Option<UserSettings>,
|
user_settings: Option<UserSettings>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
channel_unreads: Option<Vec<ChannelUnread>>,
|
channel_unreads: Option<Vec<ChannelUnread>>,
|
||||||
|
|
||||||
|
policy_changes: Vec<PolicyChange>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Ping response
|
/// Ping response
|
||||||
@@ -163,6 +165,9 @@ pub enum EventV1 {
|
|||||||
/// Server role deleted
|
/// Server role deleted
|
||||||
ServerRoleDelete { id: String, role_id: String },
|
ServerRoleDelete { id: String, role_id: String },
|
||||||
|
|
||||||
|
/// Server roles ranks updated
|
||||||
|
ServerRoleRanksUpdate { id: String, ranks: Vec<String> },
|
||||||
|
|
||||||
/// Update existing user
|
/// Update existing user
|
||||||
UserUpdate {
|
UserUpdate {
|
||||||
id: String,
|
id: String,
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ pub struct MessageSentPayload {
|
|||||||
pub users: Vec<String>,
|
pub users: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize)]
|
||||||
|
pub struct MassMessageSentPayload {
|
||||||
|
pub notifications: Vec<PushNotification>,
|
||||||
|
pub server_id: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone)]
|
#[derive(Serialize, Deserialize, Clone)]
|
||||||
pub struct FRAcceptedPayload {
|
pub struct FRAcceptedPayload {
|
||||||
pub accepted_user: User,
|
pub accepted_user: User,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ impl AbstractMigrations for MongoDb {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
/// Drop the database
|
/// Drop the database
|
||||||
async fn drop_database(&self) {
|
async fn drop_database(&self) {
|
||||||
self.db().drop(None).await.ok();
|
self.db().drop().await.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Migrate the database
|
/// Migrate the database
|
||||||
@@ -18,7 +18,7 @@ impl AbstractMigrations for MongoDb {
|
|||||||
info!("Migrating the database.");
|
info!("Migrating the database.");
|
||||||
|
|
||||||
let list = self
|
let list = self
|
||||||
.list_database_names(None, None)
|
.list_database_names()
|
||||||
.await
|
.await
|
||||||
.expect("Failed to fetch database names.");
|
.expect("Failed to fetch database names.");
|
||||||
|
|
||||||
|
|||||||
@@ -8,278 +8,258 @@ pub async fn create_database(db: &MongoDb) {
|
|||||||
info!("Creating database.");
|
info!("Creating database.");
|
||||||
let db = db.db();
|
let db = db.db();
|
||||||
|
|
||||||
db.create_collection("accounts", None)
|
db.create_collection("accounts")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create accounts collection.");
|
.expect("Failed to create accounts collection.");
|
||||||
|
|
||||||
db.create_collection("users", None)
|
db.create_collection("users")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create users collection.");
|
.expect("Failed to create users collection.");
|
||||||
|
|
||||||
db.create_collection("channels", None)
|
db.create_collection("channels")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create channels collection.");
|
.expect("Failed to create channels collection.");
|
||||||
|
|
||||||
db.create_collection("messages", None)
|
db.create_collection("messages")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create messages collection.");
|
.expect("Failed to create messages collection.");
|
||||||
|
|
||||||
db.create_collection("servers", None)
|
db.create_collection("servers")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create servers collection.");
|
.expect("Failed to create servers collection.");
|
||||||
|
|
||||||
db.create_collection("server_members", None)
|
db.create_collection("server_members")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create server_members collection.");
|
.expect("Failed to create server_members collection.");
|
||||||
|
|
||||||
db.create_collection("server_bans", None)
|
db.create_collection("server_bans")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create server_bans collection.");
|
.expect("Failed to create server_bans collection.");
|
||||||
|
|
||||||
db.create_collection("channel_invites", None)
|
db.create_collection("channel_invites")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create channel_invites collection.");
|
.expect("Failed to create channel_invites collection.");
|
||||||
|
|
||||||
db.create_collection("channel_unreads", None)
|
db.create_collection("channel_unreads")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create channel_unreads collection.");
|
.expect("Failed to create channel_unreads collection.");
|
||||||
|
|
||||||
db.create_collection("channel_webhooks", None)
|
db.create_collection("channel_webhooks")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create channel_webhooks collection.");
|
.expect("Failed to create channel_webhooks collection.");
|
||||||
|
|
||||||
db.create_collection("migrations", None)
|
db.create_collection("migrations")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create migrations collection.");
|
.expect("Failed to create migrations collection.");
|
||||||
|
|
||||||
db.create_collection("attachments", None)
|
db.create_collection("attachments")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create attachments collection.");
|
.expect("Failed to create attachments collection.");
|
||||||
|
|
||||||
db.create_collection("attachment_hashes", None)
|
db.create_collection("attachment_hashes")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create attachment_hashes collection.");
|
.expect("Failed to create attachment_hashes collection.");
|
||||||
|
|
||||||
db.create_collection("user_settings", None)
|
db.create_collection("user_settings")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create user_settings collection.");
|
.expect("Failed to create user_settings collection.");
|
||||||
|
|
||||||
db.create_collection("safety_reports", None)
|
db.create_collection("policy_changes")
|
||||||
|
.await
|
||||||
|
.expect("Failed to create policy_changes collection.");
|
||||||
|
|
||||||
|
db.create_collection("safety_reports")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create safety_reports collection.");
|
.expect("Failed to create safety_reports collection.");
|
||||||
|
|
||||||
db.create_collection("safety_snapshots", None)
|
db.create_collection("safety_snapshots")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create safety_snapshots collection.");
|
.expect("Failed to create safety_snapshots collection.");
|
||||||
|
|
||||||
db.create_collection("safety_strikes", None)
|
db.create_collection("safety_strikes")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create safety_strikes collection.");
|
.expect("Failed to create safety_strikes collection.");
|
||||||
|
|
||||||
db.create_collection("bots", None)
|
db.create_collection("bots")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create bots collection.");
|
.expect("Failed to create bots collection.");
|
||||||
|
|
||||||
db.create_collection("ratelimit_events", None)
|
db.create_collection("ratelimit_events")
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create ratelimit_events collection.");
|
.expect("Failed to create ratelimit_events collection.");
|
||||||
|
|
||||||
db.create_collection(
|
db.create_collection("pubsub")
|
||||||
"pubsub",
|
.with_options(
|
||||||
CreateCollectionOptions::builder()
|
CreateCollectionOptions::builder()
|
||||||
.capped(true)
|
.capped(true)
|
||||||
.size(1_000_000)
|
.size(1_000_000)
|
||||||
.build(),
|
.build(),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create pubsub collection.");
|
.expect("Failed to create pubsub collection.");
|
||||||
|
|
||||||
db.run_command(
|
db.run_command(doc! {
|
||||||
doc! {
|
"createIndexes": "users",
|
||||||
"createIndexes": "users",
|
"indexes": [
|
||||||
"indexes": [
|
{
|
||||||
{
|
"key": {
|
||||||
"key": {
|
"username": 1_i32
|
||||||
"username": 1_i32
|
|
||||||
},
|
|
||||||
"name": "username",
|
|
||||||
"unique": false,
|
|
||||||
"collation": {
|
|
||||||
"locale": "en",
|
|
||||||
"strength": 2_i32
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
"name": "username",
|
||||||
"key": {
|
"unique": false,
|
||||||
"username": 1_i32,
|
"collation": {
|
||||||
"discriminator": 1_i32
|
"locale": "en",
|
||||||
},
|
"strength": 2_i32
|
||||||
"name": "username_discriminator",
|
|
||||||
"unique": true,
|
|
||||||
"collation": {
|
|
||||||
"locale": "en",
|
|
||||||
"strength": 2_i32
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
},
|
{
|
||||||
None,
|
"key": {
|
||||||
)
|
"username": 1_i32,
|
||||||
|
"discriminator": 1_i32
|
||||||
|
},
|
||||||
|
"name": "username_discriminator",
|
||||||
|
"unique": true,
|
||||||
|
"collation": {
|
||||||
|
"locale": "en",
|
||||||
|
"strength": 2_i32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create username index.");
|
.expect("Failed to create username index.");
|
||||||
|
|
||||||
db.run_command(
|
db.run_command(doc! {
|
||||||
doc! {
|
"createIndexes": "messages",
|
||||||
"createIndexes": "messages",
|
"indexes": [
|
||||||
"indexes": [
|
{
|
||||||
{
|
"key": {
|
||||||
"key": {
|
"content": "text"
|
||||||
"content": "text"
|
|
||||||
},
|
|
||||||
"name": "content"
|
|
||||||
},
|
},
|
||||||
{
|
"name": "content"
|
||||||
"key": {
|
},
|
||||||
"channel": 1_i32,
|
{
|
||||||
"_id": 1_i32
|
"key": {
|
||||||
},
|
"channel": 1_i32,
|
||||||
"name": "channel_id_compound"
|
"_id": 1_i32
|
||||||
},
|
},
|
||||||
{
|
"name": "channel_id_compound"
|
||||||
"key": {
|
},
|
||||||
"author": 1_i32
|
{
|
||||||
},
|
"key": {
|
||||||
"name": "author"
|
"author": 1_i32
|
||||||
},
|
},
|
||||||
{
|
"name": "author"
|
||||||
"key": {
|
},
|
||||||
"channel": 1_i32,
|
{
|
||||||
"pinned": 1_i32
|
"key": {
|
||||||
},
|
"channel": 1_i32,
|
||||||
"name": "channel_pinned_compound"
|
"pinned": 1_i32
|
||||||
},
|
},
|
||||||
]
|
"name": "channel_pinned_compound"
|
||||||
},
|
},
|
||||||
None,
|
]
|
||||||
)
|
})
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create message index.");
|
.expect("Failed to create message index.");
|
||||||
|
|
||||||
db.run_command(
|
db.run_command(doc! {
|
||||||
doc! {
|
"createIndexes": "channel_unreads",
|
||||||
"createIndexes": "channel_unreads",
|
"indexes": [
|
||||||
"indexes": [
|
{
|
||||||
{
|
"key": {
|
||||||
"key": {
|
"_id.channel": 1_i32,
|
||||||
"_id.channel": 1_i32,
|
"_id.user": 1_i32,
|
||||||
"_id.user": 1_i32,
|
|
||||||
},
|
|
||||||
"name": "compound_id"
|
|
||||||
},
|
},
|
||||||
{
|
"name": "compound_id"
|
||||||
"key": {
|
},
|
||||||
"_id.user": 1_i32,
|
{
|
||||||
},
|
"key": {
|
||||||
"name": "user_id"
|
"_id.user": 1_i32,
|
||||||
}
|
},
|
||||||
]
|
"name": "user_id"
|
||||||
},
|
}
|
||||||
None,
|
]
|
||||||
)
|
})
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create channel_unreads index.");
|
.expect("Failed to create channel_unreads index.");
|
||||||
|
|
||||||
db.run_command(
|
db.run_command(doc! {
|
||||||
doc! {
|
"createIndexes": "server_members",
|
||||||
"createIndexes": "server_members",
|
"indexes": [
|
||||||
"indexes": [
|
{
|
||||||
{
|
"key": {
|
||||||
"key": {
|
"_id.server": 1_i32,
|
||||||
"_id.server": 1_i32,
|
"_id.user": 1_i32,
|
||||||
"_id.user": 1_i32,
|
|
||||||
},
|
|
||||||
"name": "compound_id"
|
|
||||||
},
|
},
|
||||||
{
|
"name": "compound_id"
|
||||||
"key": {
|
},
|
||||||
"_id.user": 1_i32,
|
{
|
||||||
},
|
"key": {
|
||||||
"name": "user_id"
|
"_id.user": 1_i32,
|
||||||
}
|
},
|
||||||
]
|
"name": "user_id"
|
||||||
},
|
}
|
||||||
None,
|
]
|
||||||
)
|
})
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create server_members index.");
|
.expect("Failed to create server_members index.");
|
||||||
|
|
||||||
db.run_command(
|
db.run_command(doc! {
|
||||||
doc! {
|
"createIndexes": "attachments",
|
||||||
"createIndexes": "attachments",
|
"indexes": [
|
||||||
"indexes": [
|
{
|
||||||
{
|
"key": {
|
||||||
"key": {
|
"hash": 1_i32
|
||||||
"hash": 1_i32
|
|
||||||
},
|
|
||||||
"name": "hash"
|
|
||||||
},
|
},
|
||||||
{
|
"name": "hash"
|
||||||
"key": {
|
},
|
||||||
"used_for.id": 1_i32
|
{
|
||||||
},
|
"key": {
|
||||||
"name": "used_for_id"
|
"used_for.id": 1_i32
|
||||||
}
|
},
|
||||||
]
|
"name": "used_for_id"
|
||||||
},
|
}
|
||||||
None,
|
]
|
||||||
)
|
})
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create attachments index.");
|
.expect("Failed to create attachments index.");
|
||||||
|
|
||||||
db.run_command(
|
db.run_command(doc! {
|
||||||
doc! {
|
"createIndexes": "attachment_hashes",
|
||||||
"createIndexes": "attachment_hashes",
|
"indexes": [
|
||||||
"indexes": [
|
{
|
||||||
{
|
"key": {
|
||||||
"key": {
|
"processed_hash": 1_i32
|
||||||
"processed_hash": 1_i32
|
},
|
||||||
},
|
"name": "processed_hash"
|
||||||
"name": "processed_hash"
|
}
|
||||||
}
|
]
|
||||||
]
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create attachment_hashes index.");
|
.expect("Failed to create attachment_hashes index.");
|
||||||
|
|
||||||
db.collection("migrations")
|
db.collection("migrations")
|
||||||
.insert_one(
|
.insert_one(doc! {
|
||||||
doc! {
|
"_id": 0_i32,
|
||||||
"_id": 0_i32,
|
"revision": LATEST_REVISION
|
||||||
"revision": LATEST_REVISION
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.expect("Failed to save migration info.");
|
.expect("Failed to save migration info.");
|
||||||
|
|
||||||
db.run_command(
|
db.run_command(doc! {
|
||||||
doc! {
|
"createIndexes": "ratelimit_events",
|
||||||
"createIndexes": "ratelimit_events",
|
"indexes": [
|
||||||
"indexes": [
|
{
|
||||||
{
|
"key": {
|
||||||
"key": {
|
"_id": 1_i32,
|
||||||
"_id": 1_i32,
|
"target_id": 1_i32,
|
||||||
"target_id": 1_i32,
|
"event_type": 1_i32,
|
||||||
"event_type": 1_i32,
|
},
|
||||||
},
|
"name": "compound_key"
|
||||||
"name": "compound_key"
|
}
|
||||||
}
|
]
|
||||||
]
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create ratelimit_events index.");
|
.expect("Failed to create ratelimit_events index.");
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,3 @@
|
|||||||
use revolt_config::config;
|
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
use ulid::Ulid;
|
use ulid::Ulid;
|
||||||
|
|
||||||
|
|||||||
@@ -24,12 +24,9 @@ impl AbstractChannelInvites for MongoDb {
|
|||||||
async fn fetch_invites_for_server(&self, server_id: &str) -> Result<Vec<Invite>> {
|
async fn fetch_invites_for_server(&self, server_id: &str) -> Result<Vec<Invite>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<Invite>(COL)
|
.col::<Invite>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"server": server_id,
|
||||||
"server": server_id,
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", COL))?
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ pub trait AbstractChannelUnreads: Sync + Send {
|
|||||||
message_ids: &[String],
|
message_ids: &[String],
|
||||||
) -> Result<()>;
|
) -> Result<()>;
|
||||||
|
|
||||||
|
/// Add a mention.
|
||||||
|
async fn add_mention_to_many_unreads<'a>(
|
||||||
|
&self,
|
||||||
|
channel_id: &str,
|
||||||
|
user_ids: &[String],
|
||||||
|
message_ids: &[String],
|
||||||
|
) -> Result<()>;
|
||||||
|
|
||||||
/// Fetch all unreads with mentions for a user.
|
/// Fetch all unreads with mentions for a user.
|
||||||
async fn fetch_unread_mentions(&self, user_id: &str) -> Result<Vec<ChannelUnread>>;
|
async fn fetch_unread_mentions(&self, user_id: &str) -> Result<Vec<ChannelUnread>>;
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ impl AbstractChannelUnreads for MongoDb {
|
|||||||
"last_id": message_id
|
"last_id": message_id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
)
|
||||||
|
.with_options(
|
||||||
FindOneAndUpdateOptions::builder()
|
FindOneAndUpdateOptions::builder()
|
||||||
.upsert(true)
|
.upsert(true)
|
||||||
.return_document(ReturnDocument::After)
|
.return_document(ReturnDocument::After)
|
||||||
@@ -51,15 +53,12 @@ impl AbstractChannelUnreads for MongoDb {
|
|||||||
let current_time = Ulid::new().to_string();
|
let current_time = Ulid::new().to_string();
|
||||||
|
|
||||||
self.col::<Document>(COL)
|
self.col::<Document>(COL)
|
||||||
.delete_many(
|
.delete_many(doc! {
|
||||||
doc! {
|
"_id.channel": {
|
||||||
"_id.channel": {
|
"$in": channel_ids
|
||||||
"$in": channel_ids
|
|
||||||
},
|
|
||||||
"_id.user": user_id
|
|
||||||
},
|
},
|
||||||
None,
|
"_id.user": user_id
|
||||||
)
|
})
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("delete_many", COL))?;
|
.map_err(|_| create_database_error!("delete_many", COL))?;
|
||||||
|
|
||||||
@@ -77,7 +76,6 @@ impl AbstractChannelUnreads for MongoDb {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<Document>>(),
|
.collect::<Vec<Document>>(),
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -104,13 +102,42 @@ impl AbstractChannelUnreads for MongoDb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
UpdateOptions::builder().upsert(true).build(),
|
|
||||||
)
|
)
|
||||||
|
.with_options(UpdateOptions::builder().upsert(true).build())
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
.map_err(|_| create_database_error!("update_one", COL))
|
.map_err(|_| create_database_error!("update_one", COL))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Add a mention to multiple users.
|
||||||
|
async fn add_mention_to_many_unreads<'a>(
|
||||||
|
&self,
|
||||||
|
channel_id: &str,
|
||||||
|
user_ids: &[String],
|
||||||
|
message_ids: &[String],
|
||||||
|
) -> Result<()> {
|
||||||
|
self.col::<Document>(COL)
|
||||||
|
.update_many(
|
||||||
|
doc! {
|
||||||
|
"_id.channel": channel_id,
|
||||||
|
"_id.user": {
|
||||||
|
"$in": user_ids
|
||||||
|
},
|
||||||
|
},
|
||||||
|
doc! {
|
||||||
|
"$push": {
|
||||||
|
"mentions": {
|
||||||
|
"$each": message_ids
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.with_options(UpdateOptions::builder().upsert(true).build())
|
||||||
|
.await
|
||||||
|
.map(|_| ())
|
||||||
|
.map_err(|_| create_database_error!("update_many", COL))
|
||||||
|
}
|
||||||
|
|
||||||
/// Fetch all channel unreads for a user.
|
/// Fetch all channel unreads for a user.
|
||||||
async fn fetch_unreads(&self, user_id: &str) -> Result<Vec<ChannelUnread>> {
|
async fn fetch_unreads(&self, user_id: &str) -> Result<Vec<ChannelUnread>> {
|
||||||
query!(
|
query!(
|
||||||
|
|||||||
@@ -78,6 +78,38 @@ impl AbstractChannelUnreads for ReferenceDb {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Add a mention to multiple users.
|
||||||
|
async fn add_mention_to_many_unreads<'a>(
|
||||||
|
&self,
|
||||||
|
channel_id: &str,
|
||||||
|
user_ids: &[String],
|
||||||
|
message_ids: &[String],
|
||||||
|
) -> Result<()> {
|
||||||
|
let mut unreads = self.channel_unreads.lock().await;
|
||||||
|
|
||||||
|
for user_id in user_ids {
|
||||||
|
let key = ChannelCompositeKey {
|
||||||
|
channel: channel_id.to_string(),
|
||||||
|
user: user_id.to_string(),
|
||||||
|
};
|
||||||
|
|
||||||
|
if let Some(unread) = unreads.get_mut(&key) {
|
||||||
|
unread.mentions.replace(message_ids.to_vec());
|
||||||
|
} else {
|
||||||
|
unreads.insert(
|
||||||
|
key.clone(),
|
||||||
|
ChannelUnread {
|
||||||
|
id: key,
|
||||||
|
last_id: None,
|
||||||
|
mentions: Some(message_ids.to_vec()),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
async fn fetch_unread_mentions(&self, user_id: &str) -> Result<Vec<ChannelUnread>> {
|
async fn fetch_unread_mentions(&self, user_id: &str) -> Result<Vec<ChannelUnread>> {
|
||||||
let unreads = self.channel_unreads.lock().await;
|
let unreads = self.channel_unreads.lock().await;
|
||||||
Ok(unreads
|
Ok(unreads
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ mod tests {
|
|||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
db.insert_webhook(&webhook).await.unwrap();
|
webhook.create(&db).await.unwrap();
|
||||||
|
|
||||||
let mut updated_webhook = webhook.clone();
|
let mut updated_webhook = webhook.clone();
|
||||||
updated_webhook
|
updated_webhook
|
||||||
|
|||||||
@@ -24,12 +24,9 @@ impl AbstractWebhooks for MongoDb {
|
|||||||
async fn fetch_webhooks_for_channel(&self, channel_id: &str) -> Result<Vec<Webhook>> {
|
async fn fetch_webhooks_for_channel(&self, channel_id: &str) -> Result<Vec<Webhook>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<Webhook>(COL)
|
.col::<Webhook>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"channel_id": channel_id,
|
||||||
"channel_id": channel_id,
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", COL))?
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
|
|||||||
@@ -269,16 +269,24 @@ impl Channel {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let id = ulid::Ulid::new().to_string();
|
||||||
|
|
||||||
|
let icon = if let Some(icon_id) = data.icon {
|
||||||
|
Some(File::use_channel_icon(db, &icon_id, &id, &owner_id).await?)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
let recipients = data.users.into_iter().collect::<Vec<String>>();
|
let recipients = data.users.into_iter().collect::<Vec<String>>();
|
||||||
let channel = Channel::Group {
|
let channel = Channel::Group {
|
||||||
id: ulid::Ulid::new().to_string(),
|
id,
|
||||||
|
|
||||||
name: data.name,
|
name: data.name,
|
||||||
owner: owner_id,
|
owner: owner_id,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
recipients: recipients.clone(),
|
recipients: recipients.clone(),
|
||||||
|
|
||||||
icon: None,
|
icon,
|
||||||
last_message_id: None,
|
last_message_id: None,
|
||||||
|
|
||||||
permissions: None,
|
permissions: None,
|
||||||
@@ -320,13 +328,10 @@ impl Channel {
|
|||||||
|
|
||||||
db.insert_channel(&channel).await?;
|
db.insert_channel(&channel).await?;
|
||||||
|
|
||||||
match &channel {
|
if let Channel::DirectMessage { .. } = &channel {
|
||||||
Channel::DirectMessage { .. } => {
|
let event = EventV1::ChannelCreate(channel.clone().into());
|
||||||
let event = EventV1::ChannelCreate(channel.clone().into());
|
event.clone().private(user_a.id.clone()).await;
|
||||||
event.clone().private(user_a.id.clone()).await;
|
event.private(user_b.id.clone()).await;
|
||||||
event.private(user_b.id.clone()).await;
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(channel)
|
Ok(channel)
|
||||||
|
|||||||
@@ -23,14 +23,11 @@ impl AbstractChannels for MongoDb {
|
|||||||
async fn fetch_channels<'a>(&self, ids: &'a [String]) -> Result<Vec<Channel>> {
|
async fn fetch_channels<'a>(&self, ids: &'a [String]) -> Result<Vec<Channel>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<Channel>(COL)
|
.col::<Channel>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"_id": {
|
||||||
"_id": {
|
"$in": ids
|
||||||
"$in": ids
|
}
|
||||||
}
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("fetch", "channels"))?
|
.map_err(|_| create_database_error!("fetch", "channels"))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
@@ -119,7 +116,6 @@ impl AbstractChannels for MongoDb {
|
|||||||
"recipients": user
|
"recipients": user
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -141,7 +137,6 @@ impl AbstractChannels for MongoDb {
|
|||||||
"role_permissions.".to_owned() + role: permissions
|
"role_permissions.".to_owned() + role: permissions
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -179,7 +174,6 @@ impl AbstractChannels for MongoDb {
|
|||||||
"recipients": user
|
"recipients": user
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -253,7 +247,6 @@ impl AbstractChannels for MongoDb {
|
|||||||
"_id": server.id
|
"_id": server.id
|
||||||
},
|
},
|
||||||
update,
|
update,
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("update_one", "servers"))?;
|
.map_err(|_| create_database_error!("update_one", "servers"))?;
|
||||||
@@ -274,23 +267,17 @@ impl MongoDb {
|
|||||||
pub async fn delete_associated_channel_objects(&self, id: Bson) -> Result<()> {
|
pub async fn delete_associated_channel_objects(&self, id: Bson) -> Result<()> {
|
||||||
// Delete all invites to these channels.
|
// Delete all invites to these channels.
|
||||||
self.col::<Document>("channel_invites")
|
self.col::<Document>("channel_invites")
|
||||||
.delete_many(
|
.delete_many(doc! {
|
||||||
doc! {
|
"channel": &id
|
||||||
"channel": &id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("delete_many", "channel_invites"))?;
|
.map_err(|_| create_database_error!("delete_many", "channel_invites"))?;
|
||||||
|
|
||||||
// Delete unread message objects on channels.
|
// Delete unread message objects on channels.
|
||||||
self.col::<Document>("channel_unreads")
|
self.col::<Document>("channel_unreads")
|
||||||
.delete_many(
|
.delete_many(doc! {
|
||||||
doc! {
|
"_id.channel": &id
|
||||||
"_id.channel": &id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("delete_many", "channel_unreads"))
|
.map_err(|_| create_database_error!("delete_many", "channel_unreads"))
|
||||||
.map(|_| ())?;
|
.map(|_| ())?;
|
||||||
@@ -299,12 +286,9 @@ impl MongoDb {
|
|||||||
|
|
||||||
// Delete all webhooks on this channel.
|
// Delete all webhooks on this channel.
|
||||||
self.col::<Document>("webhooks")
|
self.col::<Document>("webhooks")
|
||||||
.delete_many(
|
.delete_many(doc! {
|
||||||
doc! {
|
"channel": &id
|
||||||
"channel": &id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("delete_many", "webhooks"))
|
.map_err(|_| create_database_error!("delete_many", "webhooks"))
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ impl AbstractEmojis for MongoDb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ auto_derived_partial!(
|
|||||||
/// Size of this file (in bytes)
|
/// Size of this file (in bytes)
|
||||||
pub size: isize,
|
pub size: isize,
|
||||||
},
|
},
|
||||||
"PartialFile"
|
"PartialFileHash"
|
||||||
);
|
);
|
||||||
|
|
||||||
auto_derived!(
|
auto_derived!(
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ impl AbstractAttachmentHashes for MongoDb {
|
|||||||
"iv": nonce
|
"iv": nonce
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ impl AbstractAttachments for MongoDb {
|
|||||||
"uploader_id": uploader_id
|
"uploader_id": uploader_id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("update_one", COL))?;
|
.map_err(|_| create_database_error!("update_one", COL))?;
|
||||||
@@ -130,7 +129,6 @@ impl AbstractAttachments for MongoDb {
|
|||||||
"reported": true
|
"reported": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -149,7 +147,6 @@ impl AbstractAttachments for MongoDb {
|
|||||||
"deleted": true
|
"deleted": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -170,7 +167,6 @@ impl AbstractAttachments for MongoDb {
|
|||||||
"deleted": true
|
"deleted": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -193,7 +189,6 @@ impl MongoDb {
|
|||||||
"deleted": true
|
"deleted": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
|
|||||||
@@ -5,17 +5,20 @@ use iso8601_timestamp::Timestamp;
|
|||||||
use revolt_config::{config, FeaturesLimits};
|
use revolt_config::{config, FeaturesLimits};
|
||||||
use revolt_models::v0::{
|
use revolt_models::v0::{
|
||||||
self, BulkMessageResponse, DataMessageSend, Embed, MessageAuthor, MessageFlags, MessageSort,
|
self, BulkMessageResponse, DataMessageSend, Embed, MessageAuthor, MessageFlags, MessageSort,
|
||||||
MessageWebhook, PushNotification, ReplyIntent, SendableEmbed, Text, RE_MENTION,
|
MessageWebhook, PushNotification, ReplyIntent, SendableEmbed, Text,
|
||||||
};
|
};
|
||||||
use revolt_permissions::{ChannelPermission, PermissionValue};
|
use revolt_permissions::{calculate_channel_permissions, ChannelPermission, PermissionValue};
|
||||||
use revolt_result::Result;
|
use revolt_result::{ErrorType, Result};
|
||||||
use ulid::Ulid;
|
use ulid::Ulid;
|
||||||
use validator::Validate;
|
use validator::Validate;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
events::client::EventV1,
|
events::client::EventV1,
|
||||||
tasks::{self, ack::AckEvent},
|
tasks::{self, ack::AckEvent},
|
||||||
util::{bulk_permissions::BulkDatabasePermissionQuery, idempotency::IdempotencyKey},
|
util::{
|
||||||
|
bulk_permissions::BulkDatabasePermissionQuery, idempotency::IdempotencyKey,
|
||||||
|
permissions::DatabasePermissionQuery,
|
||||||
|
},
|
||||||
Channel, Database, Emoji, File, User, AMQP,
|
Channel, Database, Emoji, File, User, AMQP,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -53,6 +56,9 @@ auto_derived_partial!(
|
|||||||
/// Array of user ids mentioned in this message
|
/// Array of user ids mentioned in this message
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub mentions: Option<Vec<String>>,
|
pub mentions: Option<Vec<String>>,
|
||||||
|
/// Array of role ids mentioned in this message
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub role_mentions: Option<Vec<String>>,
|
||||||
/// Array of message ids this message is replying to
|
/// Array of message ids this message is replying to
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub replies: Option<Vec<String>>,
|
pub replies: Option<Vec<String>>,
|
||||||
@@ -71,7 +77,7 @@ auto_derived_partial!(
|
|||||||
|
|
||||||
/// Bitfield of message flags
|
/// Bitfield of message flags
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub flags: Option<i32>,
|
pub flags: Option<u32>,
|
||||||
},
|
},
|
||||||
"PartialMessage"
|
"PartialMessage"
|
||||||
);
|
);
|
||||||
@@ -199,6 +205,30 @@ auto_derived!(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
pub struct MessageFlagsValue(pub u32);
|
||||||
|
|
||||||
|
impl MessageFlagsValue {
|
||||||
|
pub fn has(&self, flag: MessageFlags) -> bool {
|
||||||
|
self.has_value(flag as u32)
|
||||||
|
}
|
||||||
|
pub fn has_value(&self, bit: u32) -> bool {
|
||||||
|
let mask = 1 << bit;
|
||||||
|
self.0 & mask == mask
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set(&mut self, flag: MessageFlags, toggle: bool) -> &mut Self {
|
||||||
|
self.set_value(flag as u32, toggle)
|
||||||
|
}
|
||||||
|
pub fn set_value(&mut self, bit: u32, toggle: bool) -> &mut Self {
|
||||||
|
if toggle {
|
||||||
|
self.0 |= 1 << bit;
|
||||||
|
} else {
|
||||||
|
self.0 &= !(1 << bit);
|
||||||
|
}
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(clippy::derivable_impls)]
|
#[allow(clippy::derivable_impls)]
|
||||||
impl Default for Message {
|
impl Default for Message {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
@@ -214,6 +244,7 @@ impl Default for Message {
|
|||||||
edited: None,
|
edited: None,
|
||||||
embeds: None,
|
embeds: None,
|
||||||
mentions: None,
|
mentions: None,
|
||||||
|
role_mentions: None,
|
||||||
replies: None,
|
replies: None,
|
||||||
reactions: Default::default(),
|
reactions: Default::default(),
|
||||||
interactions: Default::default(),
|
interactions: Default::default(),
|
||||||
@@ -255,20 +286,50 @@ impl Message {
|
|||||||
.map_err(|_| create_error!(InvalidOperation))?;
|
.map_err(|_| create_error!(InvalidOperation))?;
|
||||||
|
|
||||||
// Check the message is not empty
|
// Check the message is not empty
|
||||||
if (data.content.as_ref().map_or(true, |v| v.is_empty()))
|
if (data.content.as_ref().is_none_or(|v| v.is_empty()))
|
||||||
&& (data.attachments.as_ref().map_or(true, |v| v.is_empty()))
|
&& (data.attachments.as_ref().is_none_or(|v| v.is_empty()))
|
||||||
&& (data.embeds.as_ref().map_or(true, |v| v.is_empty()))
|
&& (data.embeds.as_ref().is_none_or(|v| v.is_empty()))
|
||||||
{
|
{
|
||||||
return Err(create_error!(EmptyMessage));
|
return Err(create_error!(EmptyMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure flags are either not set or have permissible values
|
let allow_mass_mentions = allow_mentions && config.features.mass_mentions_enabled;
|
||||||
if let Some(flags) = &data.flags {
|
|
||||||
if flags != &0 && flags != &1 {
|
let mut mentions_everyone = false;
|
||||||
|
let mut mentions_online = false;
|
||||||
|
let mut suppress_notifications = false;
|
||||||
|
|
||||||
|
if let Some(raw_flags) = &data.flags {
|
||||||
|
if raw_flags > &7 {
|
||||||
|
// quick path to failure: bigger than all the bits combined
|
||||||
return Err(create_error!(InvalidProperty));
|
return Err(create_error!(InvalidProperty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// First step of mass mention resolution
|
||||||
|
let flags = MessageFlagsValue(*raw_flags);
|
||||||
|
suppress_notifications = flags.has(MessageFlags::SuppressNotifications);
|
||||||
|
mentions_everyone = allow_mentions && flags.has(MessageFlags::MentionsEveryone);
|
||||||
|
mentions_online = allow_mentions && flags.has(MessageFlags::MentionsOnline);
|
||||||
|
|
||||||
|
// Not a bot, and attempting to set mention flags
|
||||||
|
if user.as_ref().is_some_and(|u| u.bot.as_ref().is_none())
|
||||||
|
&& (mentions_everyone || mentions_online)
|
||||||
|
{
|
||||||
|
return Err(create_error!(IsNotBot));
|
||||||
|
}
|
||||||
|
|
||||||
|
if mentions_everyone && mentions_online {
|
||||||
|
return Err(create_error!(InvalidFlagValue));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let server_id = match channel {
|
||||||
|
Channel::TextChannel { ref server, .. } | Channel::VoiceChannel { ref server, .. } => {
|
||||||
|
Some(server.clone())
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
|
||||||
// Ensure restrict_reactions is not specified without reactions list
|
// Ensure restrict_reactions is not specified without reactions list
|
||||||
if let Some(interactions) = &data.interactions {
|
if let Some(interactions) = &data.interactions {
|
||||||
if interactions.restrict_reactions {
|
if interactions.restrict_reactions {
|
||||||
@@ -302,18 +363,76 @@ impl Message {
|
|||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
author: author_id,
|
author: author_id,
|
||||||
webhook: webhook.map(|w| w.into()),
|
webhook: webhook.map(|w| w.into()),
|
||||||
flags: data.flags.map(|v| v as i32),
|
flags: data.flags,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parse mentions in message.
|
// Parse mentions in message.
|
||||||
let mut mentions = HashSet::new();
|
|
||||||
if allow_mentions {
|
let mut message_mentions = if let Some(raw_content) = &data.content {
|
||||||
if let Some(content) = &data.content {
|
revolt_parser::parse_message(raw_content)
|
||||||
for capture in RE_MENTION.captures_iter(content) {
|
} else {
|
||||||
if let Some(mention) = capture.get(1) {
|
revolt_parser::MessageResults::default()
|
||||||
mentions.insert(mention.as_str().to_string());
|
};
|
||||||
}
|
|
||||||
|
message_mentions.mentions_everyone |= mentions_everyone;
|
||||||
|
message_mentions.mentions_online |= mentions_online;
|
||||||
|
|
||||||
|
let revolt_parser::MessageResults {
|
||||||
|
mut user_mentions,
|
||||||
|
mut role_mentions,
|
||||||
|
mut mentions_everyone,
|
||||||
|
mut mentions_online,
|
||||||
|
} = message_mentions;
|
||||||
|
|
||||||
|
if allow_mass_mentions && server_id.is_some() && !role_mentions.is_empty() {
|
||||||
|
let server_data = db
|
||||||
|
.fetch_server(server_id.unwrap().as_str())
|
||||||
|
.await
|
||||||
|
.expect("Failed to fetch server");
|
||||||
|
|
||||||
|
role_mentions.retain(|role_id| server_data.roles.contains_key(role_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate the user can perform a mass mention
|
||||||
|
if !config.features.mass_mentions_enabled
|
||||||
|
&& (mentions_everyone || mentions_online || !role_mentions.is_empty())
|
||||||
|
{
|
||||||
|
mentions_everyone = false;
|
||||||
|
mentions_online = false;
|
||||||
|
role_mentions.clear();
|
||||||
|
} else if mentions_everyone || mentions_online || !role_mentions.is_empty() {
|
||||||
|
debug!(
|
||||||
|
"Mentioned everyone: {}, mentioned online: {}, mentioned roles: {:?}",
|
||||||
|
mentions_everyone, mentions_online, &role_mentions
|
||||||
|
);
|
||||||
|
if let Some(user) = match author {
|
||||||
|
MessageAuthor::User(user) => Some(Ok(user)),
|
||||||
|
MessageAuthor::System { .. } => Some(Err(())), // DISALLOWED
|
||||||
|
MessageAuthor::Webhook(..) => None, // Bypass check
|
||||||
|
} {
|
||||||
|
if user.is_err() {
|
||||||
|
return Err(create_error!(InvalidProperty));
|
||||||
|
}
|
||||||
|
let owned_user: User = user.unwrap().to_owned().into();
|
||||||
|
|
||||||
|
let mut query = DatabasePermissionQuery::new(db, &owned_user).channel(&channel);
|
||||||
|
let perms = calculate_channel_permissions(&mut query).await;
|
||||||
|
|
||||||
|
if (mentions_everyone || mentions_online)
|
||||||
|
&& !perms.has_channel_permission(ChannelPermission::MentionEveryone)
|
||||||
|
{
|
||||||
|
return Err(create_error!(MissingPermission {
|
||||||
|
permission: ChannelPermission::MentionEveryone.to_string()
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
if !role_mentions.is_empty()
|
||||||
|
&& !perms.has_channel_permission(ChannelPermission::MentionRoles)
|
||||||
|
{
|
||||||
|
return Err(create_error!(MissingPermission {
|
||||||
|
permission: ChannelPermission::MentionRoles.to_string()
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -327,38 +446,56 @@ impl Message {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
for ReplyIntent { id, mention } in entries {
|
for ReplyIntent {
|
||||||
let message = db.fetch_message(&id).await?;
|
id,
|
||||||
|
mention,
|
||||||
|
fail_if_not_exists,
|
||||||
|
} in entries
|
||||||
|
{
|
||||||
|
match db.fetch_message(&id).await {
|
||||||
|
// Referenced message exists
|
||||||
|
Ok(message) => {
|
||||||
|
if mention && allow_mentions {
|
||||||
|
user_mentions.insert(message.author.to_owned());
|
||||||
|
}
|
||||||
|
|
||||||
if mention && allow_mentions {
|
replies.insert(message.id);
|
||||||
mentions.insert(message.author.to_owned());
|
}
|
||||||
|
// If the referenced message doesn't exist and fail_if_not_exists
|
||||||
|
// is set to false, send the message without the reply.
|
||||||
|
Err(e) => {
|
||||||
|
if !matches!(e.error_type, ErrorType::NotFound)
|
||||||
|
|| fail_if_not_exists.unwrap_or(true)
|
||||||
|
{
|
||||||
|
return Err(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
replies.insert(message.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate the mentions go to users in the channel/server
|
// Validate the mentions go to users in the channel/server
|
||||||
if !mentions.is_empty() {
|
if !user_mentions.is_empty() {
|
||||||
match channel {
|
match channel {
|
||||||
Channel::DirectMessage { ref recipients, .. }
|
Channel::DirectMessage { ref recipients, .. }
|
||||||
| Channel::Group { ref recipients, .. } => {
|
| Channel::Group { ref recipients, .. } => {
|
||||||
let recipients_hash: HashSet<&String, RandomState> =
|
let recipients_hash = HashSet::<&String, RandomState>::from_iter(recipients);
|
||||||
HashSet::from_iter(recipients);
|
user_mentions.retain(|m| recipients_hash.contains(m));
|
||||||
mentions.retain(|m| recipients_hash.contains(m));
|
role_mentions.clear();
|
||||||
}
|
}
|
||||||
Channel::TextChannel { ref server, .. }
|
Channel::TextChannel { ref server, .. }
|
||||||
| Channel::VoiceChannel { ref server, .. } => {
|
| Channel::VoiceChannel { ref server, .. } => {
|
||||||
let mentions_vec = Vec::from_iter(mentions.iter().cloned());
|
let mentions_vec = Vec::from_iter(user_mentions.iter().cloned());
|
||||||
|
|
||||||
let valid_members = db.fetch_members(server.as_str(), &mentions_vec[..]).await;
|
let valid_members = db.fetch_members(server.as_str(), &mentions_vec[..]).await;
|
||||||
if let Ok(valid_members) = valid_members {
|
if let Ok(valid_members) = valid_members {
|
||||||
let valid_mentions: HashSet<&String, RandomState> =
|
let valid_mentions = HashSet::<&String, RandomState>::from_iter(
|
||||||
HashSet::from_iter(valid_members.iter().map(|m| &m.id.user));
|
valid_members.iter().map(|m| &m.id.user),
|
||||||
|
);
|
||||||
|
|
||||||
mentions.retain(|m| valid_mentions.contains(m)); // quick pass, validate mentions are in the server
|
user_mentions.retain(|m| valid_mentions.contains(m)); // quick pass, validate mentions are in the server
|
||||||
|
|
||||||
if !mentions.is_empty() {
|
if !user_mentions.is_empty() {
|
||||||
// if there are still mentions, drill down to a channel-level
|
// if there are still mentions, drill down to a channel-level
|
||||||
let member_channel_view_perms =
|
let member_channel_view_perms =
|
||||||
BulkDatabasePermissionQuery::from_server_id(db, server)
|
BulkDatabasePermissionQuery::from_server_id(db, server)
|
||||||
@@ -368,7 +505,7 @@ impl Message {
|
|||||||
.members_can_see_channel()
|
.members_can_see_channel()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
mentions
|
user_mentions
|
||||||
.retain(|m| *member_channel_view_perms.get(m).unwrap_or(&false));
|
.retain(|m| *member_channel_view_perms.get(m).unwrap_or(&false));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -377,13 +514,21 @@ impl Message {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Channel::SavedMessages { .. } => {
|
Channel::SavedMessages { .. } => {
|
||||||
mentions.clear();
|
user_mentions.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !mentions.is_empty() {
|
if !user_mentions.is_empty() {
|
||||||
message.mentions.replace(mentions.into_iter().collect());
|
message
|
||||||
|
.mentions
|
||||||
|
.replace(user_mentions.into_iter().collect());
|
||||||
|
}
|
||||||
|
|
||||||
|
if !role_mentions.is_empty() {
|
||||||
|
message
|
||||||
|
.role_mentions
|
||||||
|
.replace(role_mentions.into_iter().collect());
|
||||||
}
|
}
|
||||||
|
|
||||||
if !replies.is_empty() {
|
if !replies.is_empty() {
|
||||||
@@ -392,6 +537,15 @@ impl Message {
|
|||||||
.replace(replies.into_iter().collect::<Vec<String>>());
|
.replace(replies.into_iter().collect::<Vec<String>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate final message flags
|
||||||
|
let mut flag_value = MessageFlagsValue(0);
|
||||||
|
flag_value
|
||||||
|
.set(MessageFlags::SuppressNotifications, suppress_notifications)
|
||||||
|
.set(MessageFlags::MentionsEveryone, mentions_everyone)
|
||||||
|
.set(MessageFlags::MentionsOnline, mentions_online);
|
||||||
|
|
||||||
|
message.flags = Some(flag_value.0);
|
||||||
|
|
||||||
// Add attachments to message.
|
// Add attachments to message.
|
||||||
let mut attachments = vec![];
|
let mut attachments = vec![];
|
||||||
if data
|
if data
|
||||||
@@ -470,7 +624,12 @@ impl Message {
|
|||||||
tasks::ack::queue_message(
|
tasks::ack::queue_message(
|
||||||
self.channel.to_string(),
|
self.channel.to_string(),
|
||||||
AckEvent::ProcessMessage {
|
AckEvent::ProcessMessage {
|
||||||
messages: vec![(None, self.clone(), mentions.clone(), true)],
|
messages: vec![(
|
||||||
|
None,
|
||||||
|
self.clone(),
|
||||||
|
mentions.clone(),
|
||||||
|
self.has_suppressed_notifications(),
|
||||||
|
)],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
@@ -497,7 +656,7 @@ impl Message {
|
|||||||
pub async fn send(
|
pub async fn send(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
amqp: Option<&AMQP>, // this is optional mostly for tests.
|
_amqp: Option<&AMQP>, // this is optional mostly for tests.
|
||||||
author: MessageAuthor<'_>,
|
author: MessageAuthor<'_>,
|
||||||
user: Option<v0::User>,
|
user: Option<v0::User>,
|
||||||
member: Option<v0::Member>,
|
member: Option<v0::Member>,
|
||||||
@@ -514,7 +673,9 @@ impl Message {
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if !self.has_suppressed_notifications() {
|
if !self.has_suppressed_notifications()
|
||||||
|
&& (self.mentions.is_some() || self.contains_mass_push_mention())
|
||||||
|
{
|
||||||
// send Push notifications
|
// send Push notifications
|
||||||
tasks::ack::queue_message(
|
tasks::ack::queue_message(
|
||||||
self.channel.to_string(),
|
self.channel.to_string(),
|
||||||
@@ -537,7 +698,7 @@ impl Message {
|
|||||||
}
|
}
|
||||||
_ => vec![],
|
_ => vec![],
|
||||||
},
|
},
|
||||||
self.has_suppressed_notifications(),
|
false, // branch already dictates this
|
||||||
)],
|
)],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -574,13 +735,24 @@ impl Message {
|
|||||||
/// Whether this message has suppressed notifications
|
/// Whether this message has suppressed notifications
|
||||||
pub fn has_suppressed_notifications(&self) -> bool {
|
pub fn has_suppressed_notifications(&self) -> bool {
|
||||||
if let Some(flags) = self.flags {
|
if let Some(flags) = self.flags {
|
||||||
flags & MessageFlags::SuppressNotifications as i32
|
flags & MessageFlags::SuppressNotifications as u32
|
||||||
== MessageFlags::SuppressNotifications as i32
|
== MessageFlags::SuppressNotifications as u32
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn contains_mass_push_mention(&self) -> bool {
|
||||||
|
let ping = if let Some(flags) = self.flags {
|
||||||
|
let flags = MessageFlagsValue(flags);
|
||||||
|
flags.has(MessageFlags::MentionsEveryone)
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
};
|
||||||
|
|
||||||
|
ping || self.role_mentions.is_some()
|
||||||
|
}
|
||||||
|
|
||||||
/// Update message data
|
/// Update message data
|
||||||
pub async fn update(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|||||||
@@ -228,7 +228,6 @@ impl AbstractMessages for MongoDb {
|
|||||||
"_id": id
|
"_id": id
|
||||||
},
|
},
|
||||||
query,
|
query,
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -247,7 +246,6 @@ impl AbstractMessages for MongoDb {
|
|||||||
format!("reactions.{emoji}"): user
|
format!("reactions.{emoji}"): user
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -266,7 +264,6 @@ impl AbstractMessages for MongoDb {
|
|||||||
format!("reactions.{emoji}"): user
|
format!("reactions.{emoji}"): user
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -285,7 +282,6 @@ impl AbstractMessages for MongoDb {
|
|||||||
format!("reactions.{emoji}"): 1
|
format!("reactions.{emoji}"): 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -300,15 +296,12 @@ impl AbstractMessages for MongoDb {
|
|||||||
/// Delete messages from a channel by their ids and corresponding channel id
|
/// Delete messages from a channel by their ids and corresponding channel id
|
||||||
async fn delete_messages(&self, channel: &str, ids: &[String]) -> Result<()> {
|
async fn delete_messages(&self, channel: &str, ids: &[String]) -> Result<()> {
|
||||||
self.col::<Document>(COL)
|
self.col::<Document>(COL)
|
||||||
.delete_many(
|
.delete_many(doc! {
|
||||||
doc! {
|
"channel": channel,
|
||||||
"channel": channel,
|
"_id": {
|
||||||
"_id": {
|
"$in": ids
|
||||||
"$in": ids
|
}
|
||||||
}
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
.map_err(|_| create_database_error!("delete_many", COL))
|
.map_err(|_| create_database_error!("delete_many", COL))
|
||||||
@@ -362,7 +355,6 @@ impl MongoDb {
|
|||||||
"deleted": true
|
"deleted": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("update_many", "attachments"))?;
|
.map_err(|_| create_database_error!("update_many", "attachments"))?;
|
||||||
@@ -370,7 +362,7 @@ impl MongoDb {
|
|||||||
|
|
||||||
// And then delete said messages.
|
// And then delete said messages.
|
||||||
self.col::<Document>(COL)
|
self.col::<Document>(COL)
|
||||||
.delete_many(projection, None)
|
.delete_many(projection)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
.map_err(|_| create_database_error!("delete_many", COL))
|
.map_err(|_| create_database_error!("delete_many", COL))
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ mod emojis;
|
|||||||
mod file_hashes;
|
mod file_hashes;
|
||||||
mod files;
|
mod files;
|
||||||
mod messages;
|
mod messages;
|
||||||
|
mod policy_changes;
|
||||||
mod ratelimit_events;
|
mod ratelimit_events;
|
||||||
mod safety_reports;
|
mod safety_reports;
|
||||||
mod safety_snapshots;
|
mod safety_snapshots;
|
||||||
@@ -27,6 +28,7 @@ pub use emojis::*;
|
|||||||
pub use file_hashes::*;
|
pub use file_hashes::*;
|
||||||
pub use files::*;
|
pub use files::*;
|
||||||
pub use messages::*;
|
pub use messages::*;
|
||||||
|
pub use policy_changes::*;
|
||||||
pub use ratelimit_events::*;
|
pub use ratelimit_events::*;
|
||||||
pub use safety_reports::*;
|
pub use safety_reports::*;
|
||||||
pub use safety_snapshots::*;
|
pub use safety_snapshots::*;
|
||||||
@@ -51,6 +53,7 @@ pub trait AbstractDatabase:
|
|||||||
+ file_hashes::AbstractAttachmentHashes
|
+ file_hashes::AbstractAttachmentHashes
|
||||||
+ files::AbstractAttachments
|
+ files::AbstractAttachments
|
||||||
+ messages::AbstractMessages
|
+ messages::AbstractMessages
|
||||||
|
+ policy_changes::AbstractPolicyChange
|
||||||
+ ratelimit_events::AbstractRatelimitEvents
|
+ ratelimit_events::AbstractRatelimitEvents
|
||||||
+ safety_reports::AbstractReport
|
+ safety_reports::AbstractReport
|
||||||
+ safety_snapshots::AbstractSnapshot
|
+ safety_snapshots::AbstractSnapshot
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
mod model;
|
||||||
|
mod ops;
|
||||||
|
|
||||||
|
pub use model::*;
|
||||||
|
pub use ops::*;
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
use iso8601_timestamp::Timestamp;
|
||||||
|
|
||||||
|
auto_derived!(
|
||||||
|
/// Platform policy change
|
||||||
|
pub struct PolicyChange {
|
||||||
|
/// Unique Id
|
||||||
|
#[serde(rename = "_id")]
|
||||||
|
pub id: String,
|
||||||
|
|
||||||
|
/// Time at which this policy was created
|
||||||
|
pub created_time: Timestamp,
|
||||||
|
/// Time at which this policy is effective
|
||||||
|
pub effective_time: Timestamp,
|
||||||
|
|
||||||
|
/// Message shown to users
|
||||||
|
pub description: String,
|
||||||
|
/// URL with details about changes
|
||||||
|
pub url: String,
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
use revolt_result::Result;
|
||||||
|
|
||||||
|
use crate::PolicyChange;
|
||||||
|
|
||||||
|
mod mongodb;
|
||||||
|
mod reference;
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
pub trait AbstractPolicyChange: Sync + Send {
|
||||||
|
/// Fetch all policy changes
|
||||||
|
async fn fetch_policy_changes(&self) -> Result<Vec<PolicyChange>>;
|
||||||
|
|
||||||
|
/// Acknowledge policy changes
|
||||||
|
async fn acknowledge_policy_changes(&self, user_id: &str) -> Result<()>;
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
use bson::to_bson;
|
||||||
|
use iso8601_timestamp::Timestamp;
|
||||||
|
use revolt_result::Result;
|
||||||
|
|
||||||
|
use crate::MongoDb;
|
||||||
|
use crate::PolicyChange;
|
||||||
|
use crate::User;
|
||||||
|
|
||||||
|
use super::AbstractPolicyChange;
|
||||||
|
|
||||||
|
static COL: &str = "policy_changes";
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
impl AbstractPolicyChange for MongoDb {
|
||||||
|
/// Fetch all policy changes
|
||||||
|
async fn fetch_policy_changes(&self) -> Result<Vec<PolicyChange>> {
|
||||||
|
query!(self, find, COL, doc! {})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Acknowledge policy changes
|
||||||
|
async fn acknowledge_policy_changes(&self, user_id: &str) -> Result<()> {
|
||||||
|
let latest_policy = self
|
||||||
|
.fetch_policy_changes()
|
||||||
|
.await?
|
||||||
|
.into_iter()
|
||||||
|
.map(|policy| policy.created_time)
|
||||||
|
.max()
|
||||||
|
.unwrap_or(Timestamp::UNIX_EPOCH);
|
||||||
|
|
||||||
|
self.col::<User>("users")
|
||||||
|
.update_one(
|
||||||
|
doc! {
|
||||||
|
"_id": user_id
|
||||||
|
},
|
||||||
|
doc! {
|
||||||
|
"$set": {
|
||||||
|
"last_acknowledged_policy_change": to_bson(&latest_policy)
|
||||||
|
.map_err(|_| create_database_error!("to_bson", "timestamp"))?
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.map(|_| ())
|
||||||
|
.map_err(|_| create_database_error!("update_one", COL))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
use iso8601_timestamp::Timestamp;
|
||||||
|
use revolt_result::Result;
|
||||||
|
|
||||||
|
use crate::PolicyChange;
|
||||||
|
use crate::ReferenceDb;
|
||||||
|
|
||||||
|
use super::AbstractPolicyChange;
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
impl AbstractPolicyChange for ReferenceDb {
|
||||||
|
/// Fetch all policy changes
|
||||||
|
async fn fetch_policy_changes(&self) -> Result<Vec<PolicyChange>> {
|
||||||
|
let policy_changes = self.policy_changes.lock().await;
|
||||||
|
Ok(policy_changes.values().cloned().collect())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Acknowledge policy changes
|
||||||
|
async fn acknowledge_policy_changes(&self, user_id: &str) -> Result<()> {
|
||||||
|
let mut users = self.users.lock().await;
|
||||||
|
let user = users.get_mut(user_id).expect("user doesn't exist");
|
||||||
|
user.last_acknowledged_policy_change = self
|
||||||
|
.fetch_policy_changes()
|
||||||
|
.await?
|
||||||
|
.into_iter()
|
||||||
|
.map(|policy| policy.created_time)
|
||||||
|
.max()
|
||||||
|
.unwrap_or(Timestamp::UNIX_EPOCH);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,16 +23,13 @@ impl AbstractRatelimitEvents for MongoDb {
|
|||||||
count: usize,
|
count: usize,
|
||||||
) -> Result<bool> {
|
) -> Result<bool> {
|
||||||
self.col::<RatelimitEvent>(COL)
|
self.col::<RatelimitEvent>(COL)
|
||||||
.count_documents(
|
.count_documents(doc! {
|
||||||
doc! {
|
"_id": {
|
||||||
"_id": {
|
"$gte": Ulid::from_datetime(SystemTime::now() - period).to_string()
|
||||||
"$gte": Ulid::from_datetime(SystemTime::now() - period).to_string()
|
|
||||||
},
|
|
||||||
"target_id": target_id,
|
|
||||||
"event_type": event_type.to_string()
|
|
||||||
},
|
},
|
||||||
None,
|
"target_id": target_id,
|
||||||
)
|
"event_type": event_type.to_string()
|
||||||
|
})
|
||||||
.await
|
.await
|
||||||
.map(|c| c as usize >= count)
|
.map(|c| c as usize >= count)
|
||||||
.map_err(|_| create_database_error!("count_documents", COL))
|
.map_err(|_| create_database_error!("count_documents", COL))
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ impl SnapshotContent {
|
|||||||
Ok((
|
Ok((
|
||||||
SnapshotContent::Message {
|
SnapshotContent::Message {
|
||||||
message,
|
message,
|
||||||
prior_context: prior_context.into_iter().map(Into::into).collect(),
|
prior_context: prior_context.into_iter().collect(),
|
||||||
leading_context: leading_context.into_iter().map(Into::into).collect(),
|
leading_context: leading_context.into_iter().collect(),
|
||||||
},
|
},
|
||||||
files,
|
files,
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ auto_derived!(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[allow(clippy::disallowed_methods)]
|
||||||
impl ServerBan {
|
impl ServerBan {
|
||||||
/// Create ban
|
/// Create ban
|
||||||
pub async fn create(
|
pub async fn create(
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ impl Member {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update member data
|
/// Update member data
|
||||||
pub async fn update<'a>(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
partial: PartialMember,
|
partial: PartialMember,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use ::mongodb::SessionCursor;
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
|
|
||||||
use crate::{FieldsMember, Member, MemberCompositeKey, PartialMember};
|
use crate::{FieldsMember, Member, MemberCompositeKey, PartialMember};
|
||||||
@@ -5,6 +6,66 @@ use crate::{FieldsMember, Member, MemberCompositeKey, PartialMember};
|
|||||||
mod mongodb;
|
mod mongodb;
|
||||||
mod reference;
|
mod reference;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum ChunkedServerMembersGenerator {
|
||||||
|
#[cfg(feature = "mongodb")]
|
||||||
|
MongoDb {
|
||||||
|
session: ::mongodb::ClientSession,
|
||||||
|
cursor: Option<SessionCursor<Member>>,
|
||||||
|
},
|
||||||
|
|
||||||
|
Reference {
|
||||||
|
offset: i32,
|
||||||
|
data: Option<Vec<Member>>,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ChunkedServerMembersGenerator {
|
||||||
|
#[cfg(feature = "mongodb")]
|
||||||
|
pub fn new_mongo(session: ::mongodb::ClientSession, cursor: SessionCursor<Member>) -> Self {
|
||||||
|
ChunkedServerMembersGenerator::MongoDb {
|
||||||
|
session,
|
||||||
|
cursor: Some(cursor),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn new_reference(data: Vec<Member>) -> Self {
|
||||||
|
ChunkedServerMembersGenerator::Reference {
|
||||||
|
offset: 0,
|
||||||
|
data: Some(data),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn next(&mut self) -> Option<Member> {
|
||||||
|
match self {
|
||||||
|
#[cfg(feature = "mongodb")]
|
||||||
|
ChunkedServerMembersGenerator::MongoDb { session, cursor } => {
|
||||||
|
if let Some(cursor) = cursor {
|
||||||
|
let value = cursor.next(session).await;
|
||||||
|
value.map(|val| val.expect("Failed to fetch the next member"))
|
||||||
|
} else {
|
||||||
|
warn!("Attempted to access a (MongoDb) server member generator without first setting a cursor");
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ChunkedServerMembersGenerator::Reference { offset, data } => {
|
||||||
|
if let Some(data) = data {
|
||||||
|
if data.len() as i32 >= *offset {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
let resp = &data[*offset as usize];
|
||||||
|
*offset += 1;
|
||||||
|
Some(resp.clone())
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
warn!("Attempted to access a (Reference) server member generator without first providing data");
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait AbstractServerMembers: Sync + Send {
|
pub trait AbstractServerMembers: Sync + Send {
|
||||||
/// Insert a new server member into the database
|
/// Insert a new server member into the database
|
||||||
@@ -16,6 +77,24 @@ pub trait AbstractServerMembers: Sync + Send {
|
|||||||
/// Fetch all members in a server
|
/// Fetch all members in a server
|
||||||
async fn fetch_all_members<'a>(&self, server_id: &str) -> Result<Vec<Member>>;
|
async fn fetch_all_members<'a>(&self, server_id: &str) -> Result<Vec<Member>>;
|
||||||
|
|
||||||
|
/// Fetch all members in a server as an iterator
|
||||||
|
async fn fetch_all_members_chunked(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
) -> Result<ChunkedServerMembersGenerator>;
|
||||||
|
|
||||||
|
async fn fetch_all_members_with_roles(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
roles: &[String],
|
||||||
|
) -> Result<Vec<Member>>;
|
||||||
|
|
||||||
|
async fn fetch_all_members_with_roles_chunked(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
roles: &[String],
|
||||||
|
) -> Result<ChunkedServerMembersGenerator>;
|
||||||
|
|
||||||
/// Fetch all memberships for a user
|
/// Fetch all memberships for a user
|
||||||
async fn fetch_all_memberships<'a>(&self, user_id: &str) -> Result<Vec<Member>>;
|
async fn fetch_all_memberships<'a>(&self, user_id: &str) -> Result<Vec<Member>>;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
use mongodb::options::ReadConcern;
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
|
|
||||||
use crate::{FieldsMember, Member, MemberCompositeKey, PartialMember};
|
use crate::{FieldsMember, Member, MemberCompositeKey, PartialMember};
|
||||||
use crate::{IntoDocumentPath, MongoDb};
|
use crate::{IntoDocumentPath, MongoDb};
|
||||||
|
|
||||||
use super::AbstractServerMembers;
|
use super::{AbstractServerMembers, ChunkedServerMembersGenerator};
|
||||||
|
|
||||||
static COL: &str = "server_members";
|
static COL: &str = "server_members";
|
||||||
|
|
||||||
@@ -33,12 +34,9 @@ impl AbstractServerMembers for MongoDb {
|
|||||||
async fn fetch_all_members<'a>(&self, server_id: &str) -> Result<Vec<Member>> {
|
async fn fetch_all_members<'a>(&self, server_id: &str) -> Result<Vec<Member>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<Member>(COL)
|
.col::<Member>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"_id.server": server_id
|
||||||
"_id.server": server_id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", COL))?
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
@@ -52,16 +50,101 @@ impl AbstractServerMembers for MongoDb {
|
|||||||
.await)
|
.await)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Fetch all members in a server as a generator.
|
||||||
|
/// Uses config key pushd.mass_mention_chunk_size as the batch size.
|
||||||
|
async fn fetch_all_members_chunked(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
) -> Result<ChunkedServerMembersGenerator> {
|
||||||
|
let config = revolt_config::config().await;
|
||||||
|
|
||||||
|
let mut session = self
|
||||||
|
.start_session()
|
||||||
|
.await
|
||||||
|
.map_err(|_| create_database_error!("start_session", COL))?;
|
||||||
|
|
||||||
|
session
|
||||||
|
.start_transaction()
|
||||||
|
.read_concern(ReadConcern::snapshot())
|
||||||
|
.await
|
||||||
|
.map_err(|_| create_database_error!("start_transaction", COL))?;
|
||||||
|
|
||||||
|
let cursor = self
|
||||||
|
.col::<Member>(COL)
|
||||||
|
.find(doc! {
|
||||||
|
"_id.server": server_id
|
||||||
|
})
|
||||||
|
.session(&mut session)
|
||||||
|
.batch_size(config.pushd.mass_mention_chunk_size as u32)
|
||||||
|
.await
|
||||||
|
.map_err(|_| create_database_error!("find", COL))?;
|
||||||
|
|
||||||
|
Ok(ChunkedServerMembersGenerator::new_mongo(session, cursor))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn fetch_all_members_with_roles(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
roles: &[String],
|
||||||
|
) -> Result<Vec<Member>> {
|
||||||
|
Ok(self
|
||||||
|
.col::<Member>(COL)
|
||||||
|
.find(doc! {
|
||||||
|
"_id.server": server_id,
|
||||||
|
"roles": {"$in": roles}
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
|
.filter_map(|s| async {
|
||||||
|
if cfg!(debug_assertions) {
|
||||||
|
Some(s.unwrap())
|
||||||
|
} else {
|
||||||
|
s.ok()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
|
.await)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn fetch_all_members_with_roles_chunked(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
roles: &[String],
|
||||||
|
) -> Result<ChunkedServerMembersGenerator> {
|
||||||
|
let config = revolt_config::config().await;
|
||||||
|
|
||||||
|
let mut session = self
|
||||||
|
.start_session()
|
||||||
|
.await
|
||||||
|
.map_err(|_| create_database_error!("start_session", COL))?;
|
||||||
|
|
||||||
|
session
|
||||||
|
.start_transaction()
|
||||||
|
.read_concern(ReadConcern::snapshot())
|
||||||
|
.await
|
||||||
|
.map_err(|_| create_database_error!("start_transaction", COL))?;
|
||||||
|
|
||||||
|
let cursor = self
|
||||||
|
.col::<Member>(COL)
|
||||||
|
.find(doc! {
|
||||||
|
"_id.server": server_id,
|
||||||
|
"roles": {"$in": roles}
|
||||||
|
})
|
||||||
|
.session(&mut session)
|
||||||
|
.batch_size(config.pushd.mass_mention_chunk_size as u32)
|
||||||
|
.await
|
||||||
|
.map_err(|_| create_database_error!("find", COL))?;
|
||||||
|
|
||||||
|
return Ok(ChunkedServerMembersGenerator::new_mongo(session, cursor));
|
||||||
|
}
|
||||||
|
|
||||||
/// Fetch all memberships for a user
|
/// Fetch all memberships for a user
|
||||||
async fn fetch_all_memberships<'a>(&self, user_id: &str) -> Result<Vec<Member>> {
|
async fn fetch_all_memberships<'a>(&self, user_id: &str) -> Result<Vec<Member>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<Member>(COL)
|
.col::<Member>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"_id.user": user_id
|
||||||
"_id.user": user_id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", COL))?
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
@@ -79,15 +162,12 @@ impl AbstractServerMembers for MongoDb {
|
|||||||
async fn fetch_members<'a>(&self, server_id: &str, ids: &'a [String]) -> Result<Vec<Member>> {
|
async fn fetch_members<'a>(&self, server_id: &str, ids: &'a [String]) -> Result<Vec<Member>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<Member>(COL)
|
.col::<Member>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"_id.server": server_id,
|
||||||
"_id.server": server_id,
|
"_id.user": {
|
||||||
"_id.user": {
|
"$in": ids
|
||||||
"$in": ids
|
}
|
||||||
}
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", COL))?
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
@@ -104,12 +184,9 @@ impl AbstractServerMembers for MongoDb {
|
|||||||
/// Fetch member count of a server
|
/// Fetch member count of a server
|
||||||
async fn fetch_member_count(&self, server_id: &str) -> Result<usize> {
|
async fn fetch_member_count(&self, server_id: &str) -> Result<usize> {
|
||||||
self.col::<Member>(COL)
|
self.col::<Member>(COL)
|
||||||
.count_documents(
|
.count_documents(doc! {
|
||||||
doc! {
|
"_id.server": server_id
|
||||||
"_id.server": server_id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map(|c| c as usize)
|
.map(|c| c as usize)
|
||||||
.map_err(|_| create_database_error!("count_documents", COL))
|
.map_err(|_| create_database_error!("count_documents", COL))
|
||||||
@@ -118,12 +195,9 @@ impl AbstractServerMembers for MongoDb {
|
|||||||
/// Fetch server count of a user
|
/// Fetch server count of a user
|
||||||
async fn fetch_server_count(&self, user_id: &str) -> Result<usize> {
|
async fn fetch_server_count(&self, user_id: &str) -> Result<usize> {
|
||||||
self.col::<Member>(COL)
|
self.col::<Member>(COL)
|
||||||
.count_documents(
|
.count_documents(doc! {
|
||||||
doc! {
|
"_id.user": user_id
|
||||||
"_id.user": user_id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map(|c| c as usize)
|
.map(|c| c as usize)
|
||||||
.map_err(|_| create_database_error!("count_documents", COL))
|
.map_err(|_| create_database_error!("count_documents", COL))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use revolt_result::Result;
|
|||||||
use crate::ReferenceDb;
|
use crate::ReferenceDb;
|
||||||
use crate::{FieldsMember, Member, MemberCompositeKey, PartialMember};
|
use crate::{FieldsMember, Member, MemberCompositeKey, PartialMember};
|
||||||
|
|
||||||
use super::AbstractServerMembers;
|
use super::{AbstractServerMembers, ChunkedServerMembersGenerator};
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl AbstractServerMembers for ReferenceDb {
|
impl AbstractServerMembers for ReferenceDb {
|
||||||
@@ -40,6 +40,70 @@ impl AbstractServerMembers for ReferenceDb {
|
|||||||
.collect())
|
.collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Fetch all members in a server as an iterator
|
||||||
|
async fn fetch_all_members_chunked(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
) -> Result<ChunkedServerMembersGenerator> {
|
||||||
|
let server_members = self.server_members.lock().await;
|
||||||
|
|
||||||
|
let members = server_members
|
||||||
|
.clone()
|
||||||
|
.into_values()
|
||||||
|
.filter(move |member| member.id.server == server_id)
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
// this is inefficient as shit but its the reference db so its fine
|
||||||
|
Ok(ChunkedServerMembersGenerator::new_reference(members))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fetch all members that have any of the roles given
|
||||||
|
async fn fetch_all_members_with_roles(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
roles: &[String],
|
||||||
|
) -> Result<Vec<Member>> {
|
||||||
|
let server_members = self.server_members.lock().await;
|
||||||
|
|
||||||
|
Ok(server_members
|
||||||
|
.clone()
|
||||||
|
.into_values()
|
||||||
|
.filter(|member| {
|
||||||
|
member.id.server == server_id
|
||||||
|
&& !member
|
||||||
|
.roles
|
||||||
|
.iter()
|
||||||
|
.filter(|p| roles.contains(*p))
|
||||||
|
.collect::<Vec<&String>>()
|
||||||
|
.is_empty()
|
||||||
|
})
|
||||||
|
.collect())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn fetch_all_members_with_roles_chunked(
|
||||||
|
&self,
|
||||||
|
server_id: &str,
|
||||||
|
roles: &[String],
|
||||||
|
) -> Result<ChunkedServerMembersGenerator> {
|
||||||
|
let server_members = self.server_members.lock().await;
|
||||||
|
|
||||||
|
let resp = server_members
|
||||||
|
.clone()
|
||||||
|
.into_values()
|
||||||
|
.filter(|member| {
|
||||||
|
member.id.server == server_id
|
||||||
|
&& !member
|
||||||
|
.roles
|
||||||
|
.iter()
|
||||||
|
.filter(|p| roles.contains(*p))
|
||||||
|
.collect::<Vec<&String>>()
|
||||||
|
.is_empty()
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
return Ok(ChunkedServerMembersGenerator::new_reference(resp));
|
||||||
|
}
|
||||||
|
|
||||||
/// Fetch all memberships for a user
|
/// Fetch all memberships for a user
|
||||||
async fn fetch_all_memberships<'a>(&self, user_id: &str) -> Result<Vec<Member>> {
|
async fn fetch_all_memberships<'a>(&self, user_id: &str) -> Result<Vec<Member>> {
|
||||||
let server_members = self.server_members.lock().await;
|
let server_members = self.server_members.lock().await;
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ impl Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update server data
|
/// Update server data
|
||||||
pub async fn update<'a>(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
partial: PartialServer,
|
partial: PartialServer,
|
||||||
@@ -228,6 +228,13 @@ impl Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Ordered roles list
|
||||||
|
pub fn ordered_roles(&self) -> Vec<(String, Role)> {
|
||||||
|
let mut ordered_roles = self.roles.clone().into_iter().collect::<Vec<_>>();
|
||||||
|
ordered_roles.sort_by(|(_, role_a), (_, role_b)| role_a.rank.cmp(&role_b.rank));
|
||||||
|
ordered_roles
|
||||||
|
}
|
||||||
|
|
||||||
/// Set role permission on a server
|
/// Set role permission on a server
|
||||||
pub async fn set_role_permission(
|
pub async fn set_role_permission(
|
||||||
&mut self,
|
&mut self,
|
||||||
@@ -253,6 +260,37 @@ impl Server {
|
|||||||
Err(create_error!(NotFound))
|
Err(create_error!(NotFound))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Reorders the server's roles rankings
|
||||||
|
pub async fn set_role_ordering(&mut self, db: &Database, new_order: Vec<String>) -> Result<()> {
|
||||||
|
// New order must always contain every role
|
||||||
|
debug_assert_eq!(self.roles.len(), new_order.len());
|
||||||
|
|
||||||
|
// Set the role's ranks to the positions in the vec
|
||||||
|
for (rank, id) in new_order.iter().enumerate() {
|
||||||
|
self.roles.get_mut(id).unwrap().rank = rank as i64;
|
||||||
|
}
|
||||||
|
|
||||||
|
db.update_server(
|
||||||
|
&self.id,
|
||||||
|
&PartialServer {
|
||||||
|
roles: Some(self.roles.clone()),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
Vec::new(),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
// Publish bulk update event
|
||||||
|
EventV1::ServerRoleRanksUpdate {
|
||||||
|
id: self.id.clone(),
|
||||||
|
ranks: new_order,
|
||||||
|
}
|
||||||
|
.p(self.id.clone())
|
||||||
|
.await;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Role {
|
impl Role {
|
||||||
@@ -285,7 +323,7 @@ impl Role {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update server data
|
/// Update server data
|
||||||
pub async fn update<'a>(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
server_id: &str,
|
server_id: &str,
|
||||||
|
|||||||
@@ -25,14 +25,11 @@ impl AbstractServers for MongoDb {
|
|||||||
async fn fetch_servers<'a>(&self, ids: &'a [String]) -> Result<Vec<Server>> {
|
async fn fetch_servers<'a>(&self, ids: &'a [String]) -> Result<Vec<Server>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<Server>(COL)
|
.col::<Server>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"_id": {
|
||||||
"_id": {
|
"$in": ids
|
||||||
"$in": ids
|
}
|
||||||
}
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", "servers"))?
|
.map_err(|_| create_database_error!("find", "servers"))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
@@ -84,7 +81,6 @@ impl AbstractServers for MongoDb {
|
|||||||
.map_err(|_| create_database_error!("to_document", "role"))?
|
.map_err(|_| create_database_error!("to_document", "role"))?
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -125,7 +121,6 @@ impl AbstractServers for MongoDb {
|
|||||||
"roles": &role_id
|
"roles": &role_id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("update_many", "server_members"))?;
|
.map_err(|_| create_database_error!("update_many", "server_members"))?;
|
||||||
@@ -140,7 +135,6 @@ impl AbstractServers for MongoDb {
|
|||||||
"role_permissions.".to_owned() + role_id: 1_i32
|
"role_permissions.".to_owned() + role_id: 1_i32
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("update_one", "channels"))?;
|
.map_err(|_| create_database_error!("update_one", "channels"))?;
|
||||||
@@ -155,7 +149,6 @@ impl AbstractServers for MongoDb {
|
|||||||
"roles.".to_owned() + role_id: 1_i32
|
"roles.".to_owned() + role_id: 1_i32
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -188,12 +181,9 @@ impl MongoDb {
|
|||||||
// Find all channels
|
// Find all channels
|
||||||
let channels: Vec<String> = self
|
let channels: Vec<String> = self
|
||||||
.col::<Document>("channels")
|
.col::<Document>("channels")
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"server": server_id
|
||||||
"server": server_id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", "channels"))?
|
.map_err(|_| create_database_error!("find", "channels"))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
@@ -225,19 +215,15 @@ impl MongoDb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("update_many", "emojis"))?;
|
.map_err(|_| create_database_error!("update_many", "emojis"))?;
|
||||||
|
|
||||||
// Delete all channels.
|
// Delete all channels.
|
||||||
self.col::<Document>("channels")
|
self.col::<Document>("channels")
|
||||||
.delete_many(
|
.delete_many(doc! {
|
||||||
doc! {
|
"server": &server_id
|
||||||
"server": &server_id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("delete_many", "channels"))?;
|
.map_err(|_| create_database_error!("delete_many", "channels"))?;
|
||||||
|
|
||||||
@@ -248,12 +234,9 @@ impl MongoDb {
|
|||||||
// Delete members and bans.
|
// Delete members and bans.
|
||||||
for with in &["server_members", "server_bans"] {
|
for with in &["server_members", "server_bans"] {
|
||||||
self.col::<Document>(with)
|
self.col::<Document>(with)
|
||||||
.delete_many(
|
.delete_many(doc! {
|
||||||
doc! {
|
"_id.server": &server_id
|
||||||
"_id.server": &server_id
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("delete_many", with))?;
|
.map_err(|_| create_database_error!("delete_many", with))?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ impl AbstractUserSettings for MongoDb {
|
|||||||
doc! {
|
doc! {
|
||||||
"$set": set
|
"$set": set
|
||||||
},
|
},
|
||||||
UpdateOptions::builder().upsert(true).build(),
|
|
||||||
)
|
)
|
||||||
|
.with_options(UpdateOptions::builder().upsert(true).build())
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
.map_err(|_| create_database_error!("update_one", "user_settings"))
|
.map_err(|_| create_database_error!("update_one", "user_settings"))
|
||||||
|
|||||||
@@ -7,11 +7,5 @@ mod rocket;
|
|||||||
#[cfg(feature = "rocket-impl")]
|
#[cfg(feature = "rocket-impl")]
|
||||||
mod schema;
|
mod schema;
|
||||||
|
|
||||||
#[cfg(feature = "axum-impl")]
|
|
||||||
pub use self::axum::*;
|
|
||||||
#[cfg(feature = "rocket-impl")]
|
|
||||||
pub use self::rocket::*;
|
|
||||||
#[cfg(feature = "rocket-impl")]
|
|
||||||
pub use self::schema::*;
|
|
||||||
pub use model::*;
|
pub use model::*;
|
||||||
pub use ops::*;
|
pub use ops::*;
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ use std::{collections::HashSet, str::FromStr, time::Duration};
|
|||||||
use crate::{events::client::EventV1, Database, File, RatelimitEvent, AMQP};
|
use crate::{events::client::EventV1, Database, File, RatelimitEvent, AMQP};
|
||||||
|
|
||||||
use authifier::config::{EmailVerificationConfig, Template};
|
use authifier::config::{EmailVerificationConfig, Template};
|
||||||
|
use futures::future::join_all;
|
||||||
use iso8601_timestamp::Timestamp;
|
use iso8601_timestamp::Timestamp;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
use revolt_config::{config, FeaturesLimits};
|
use revolt_config::{config, FeaturesLimits};
|
||||||
use revolt_models::v0::{self, UserFlags};
|
use revolt_models::v0::{self, UserBadges, UserFlags};
|
||||||
use revolt_presence::filter_online;
|
use revolt_presence::filter_online;
|
||||||
use revolt_result::{create_error, Result};
|
use revolt_result::{create_error, Result};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
@@ -56,6 +57,8 @@ auto_derived_partial!(
|
|||||||
/// Time until user is unsuspended
|
/// Time until user is unsuspended
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub suspended_until: Option<Timestamp>,
|
pub suspended_until: Option<Timestamp>,
|
||||||
|
/// Last acknowledged policy change
|
||||||
|
pub last_acknowledged_policy_change: Timestamp,
|
||||||
},
|
},
|
||||||
"PartialUser"
|
"PartialUser"
|
||||||
);
|
);
|
||||||
@@ -177,6 +180,7 @@ impl Default for User {
|
|||||||
privileged: Default::default(),
|
privileged: Default::default(),
|
||||||
bot: Default::default(),
|
bot: Default::default(),
|
||||||
suspended_until: Default::default(),
|
suspended_until: Default::default(),
|
||||||
|
last_acknowledged_policy_change: Timestamp::UNIX_EPOCH,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,6 +203,7 @@ impl User {
|
|||||||
id: account_id.into().unwrap_or_else(|| Ulid::new().to_string()),
|
id: account_id.into().unwrap_or_else(|| Ulid::new().to_string()),
|
||||||
discriminator: User::find_discriminator(db, &username, None).await?,
|
discriminator: User::find_discriminator(db, &username, None).await?,
|
||||||
username,
|
username,
|
||||||
|
last_acknowledged_policy_change: Timestamp::now_utc(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -348,15 +353,13 @@ impl User {
|
|||||||
) -> Result<Vec<v0::User>> {
|
) -> Result<Vec<v0::User>> {
|
||||||
let online_ids = filter_online(ids).await;
|
let online_ids = filter_online(ids).await;
|
||||||
|
|
||||||
Ok(db
|
Ok(
|
||||||
.fetch_users(ids)
|
join_all(db.fetch_users(ids).await?.into_iter().map(|user| async {
|
||||||
.await?
|
|
||||||
.into_iter()
|
|
||||||
.map(|user| {
|
|
||||||
let is_online = online_ids.contains(&user.id);
|
let is_online = online_ids.contains(&user.id);
|
||||||
user.into_known(perspective, is_online)
|
user.into_known(perspective, is_online).await
|
||||||
})
|
}))
|
||||||
.collect())
|
.await,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find a free discriminator for a given username
|
/// Find a free discriminator for a given username
|
||||||
@@ -637,7 +640,7 @@ impl User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Update user data
|
/// Update user data
|
||||||
pub async fn update<'a>(
|
pub async fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
db: &Database,
|
db: &Database,
|
||||||
partial: PartialUser,
|
partial: PartialUser,
|
||||||
@@ -807,4 +810,18 @@ impl User {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gets the user's badges along with calculating any dynamic badges
|
||||||
|
pub async fn get_badges(&self) -> u32 {
|
||||||
|
let config = config().await;
|
||||||
|
let badges = self.badges.unwrap_or_default() as u32;
|
||||||
|
|
||||||
|
if let Some(cutoff) = config.api.users.early_adopter_cutoff {
|
||||||
|
if Ulid::from_string(&self.id).unwrap().timestamp_ms() < cutoff {
|
||||||
|
return badges + UserBadges::EarlyAdopter as u32;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
badges
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
use authifier::models::Session;
|
use authifier::models::Session;
|
||||||
|
use iso8601_timestamp::Timestamp;
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
|
|
||||||
use crate::{FieldsUser, PartialUser, RelationshipStatus, User};
|
use crate::{FieldsUser, PartialUser, RelationshipStatus, User};
|
||||||
@@ -61,4 +62,6 @@ pub trait AbstractUsers: Sync + Send {
|
|||||||
|
|
||||||
/// Remove push subscription for a session by session id (TODO: remove)
|
/// Remove push subscription for a session by session id (TODO: remove)
|
||||||
async fn remove_push_subscription_by_session_id(&self, session_id: &str) -> Result<()>;
|
async fn remove_push_subscription_by_session_id(&self, session_id: &str) -> Result<()>;
|
||||||
|
|
||||||
|
async fn update_session_last_seen(&self, session_id: &str, when: Timestamp) -> Result<()>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use ::mongodb::options::{Collation, CollationStrength, FindOneOptions, FindOptions};
|
use ::mongodb::options::{Collation, CollationStrength, FindOneOptions, FindOptions};
|
||||||
use authifier::models::Session;
|
use authifier::models::Session;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
use iso8601_timestamp::Timestamp;
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
|
|
||||||
use crate::DocumentId;
|
use crate::DocumentId;
|
||||||
@@ -49,12 +50,9 @@ impl AbstractUsers for MongoDb {
|
|||||||
/// Fetch a session from the database by token
|
/// Fetch a session from the database by token
|
||||||
async fn fetch_session_by_token(&self, token: &str) -> Result<Session> {
|
async fn fetch_session_by_token(&self, token: &str) -> Result<Session> {
|
||||||
self.col::<Session>("sessions")
|
self.col::<Session>("sessions")
|
||||||
.find_one(
|
.find_one(doc! {
|
||||||
doc! {
|
"token": token
|
||||||
"token": token
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find_one", "sessions"))?
|
.map_err(|_| create_database_error!("find_one", "sessions"))?
|
||||||
.ok_or_else(|| create_error!(InvalidSession))
|
.ok_or_else(|| create_error!(InvalidSession))
|
||||||
@@ -64,14 +62,11 @@ impl AbstractUsers for MongoDb {
|
|||||||
async fn fetch_users<'a>(&self, ids: &'a [String]) -> Result<Vec<User>> {
|
async fn fetch_users<'a>(&self, ids: &'a [String]) -> Result<Vec<User>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<User>(COL)
|
.col::<User>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"_id": {
|
||||||
"_id": {
|
"$in": ids
|
||||||
"$in": ids
|
}
|
||||||
}
|
})
|
||||||
},
|
|
||||||
None,
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", COL))?
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
.filter_map(|s| async {
|
.filter_map(|s| async {
|
||||||
@@ -94,10 +89,10 @@ impl AbstractUsers for MongoDb {
|
|||||||
|
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<UserDocument>(COL)
|
.col::<UserDocument>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"username": username
|
||||||
"username": username
|
})
|
||||||
},
|
.with_options(
|
||||||
FindOptions::builder()
|
FindOptions::builder()
|
||||||
.collation(
|
.collation(
|
||||||
Collation::builder()
|
Collation::builder()
|
||||||
@@ -122,15 +117,13 @@ impl AbstractUsers for MongoDb {
|
|||||||
async fn fetch_mutual_user_ids(&self, user_a: &str, user_b: &str) -> Result<Vec<String>> {
|
async fn fetch_mutual_user_ids(&self, user_a: &str, user_b: &str) -> Result<Vec<String>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<DocumentId>(COL)
|
.col::<DocumentId>(COL)
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"$and": [
|
||||||
"$and": [
|
{ "relations": { "$elemMatch": { "_id": &user_a, "status": "Friend" } } },
|
||||||
{ "relations": { "$elemMatch": { "_id": &user_a, "status": "Friend" } } },
|
{ "relations": { "$elemMatch": { "_id": &user_b, "status": "Friend" } } }
|
||||||
{ "relations": { "$elemMatch": { "_id": &user_b, "status": "Friend" } } }
|
]
|
||||||
]
|
})
|
||||||
},
|
.with_options(FindOptions::builder().projection(doc! { "_id": 1 }).build())
|
||||||
FindOptions::builder().projection(doc! { "_id": 1 }).build(),
|
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", COL))?
|
.map_err(|_| create_database_error!("find", COL))?
|
||||||
.filter_map(|s| async { s.ok() })
|
.filter_map(|s| async { s.ok() })
|
||||||
@@ -143,17 +136,15 @@ impl AbstractUsers for MongoDb {
|
|||||||
async fn fetch_mutual_channel_ids(&self, user_a: &str, user_b: &str) -> Result<Vec<String>> {
|
async fn fetch_mutual_channel_ids(&self, user_a: &str, user_b: &str) -> Result<Vec<String>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<DocumentId>("channels")
|
.col::<DocumentId>("channels")
|
||||||
.find(
|
.find(doc! {
|
||||||
doc! {
|
"channel_type": {
|
||||||
"channel_type": {
|
"$in": ["Group", "DirectMessage"]
|
||||||
"$in": ["Group", "DirectMessage"]
|
|
||||||
},
|
|
||||||
"recipients": {
|
|
||||||
"$all": [ user_a, user_b ]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
FindOptions::builder().projection(doc! { "_id": 1 }).build(),
|
"recipients": {
|
||||||
)
|
"$all": [ user_a, user_b ]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.with_options(FindOptions::builder().projection(doc! { "_id": 1 }).build())
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("find", "channels"))?
|
.map_err(|_| create_database_error!("find", "channels"))?
|
||||||
.filter_map(|s| async { s.ok() })
|
.filter_map(|s| async { s.ok() })
|
||||||
@@ -166,49 +157,46 @@ impl AbstractUsers for MongoDb {
|
|||||||
async fn fetch_mutual_server_ids(&self, user_a: &str, user_b: &str) -> Result<Vec<String>> {
|
async fn fetch_mutual_server_ids(&self, user_a: &str, user_b: &str) -> Result<Vec<String>> {
|
||||||
Ok(self
|
Ok(self
|
||||||
.col::<DocumentId>("server_members")
|
.col::<DocumentId>("server_members")
|
||||||
.aggregate(
|
.aggregate(vec![
|
||||||
vec![
|
doc! {
|
||||||
doc! {
|
"$match": {
|
||||||
"$match": {
|
"_id.user": user_a
|
||||||
"_id.user": user_a
|
}
|
||||||
}
|
},
|
||||||
},
|
doc! {
|
||||||
doc! {
|
"$lookup": {
|
||||||
"$lookup": {
|
"from": "server_members",
|
||||||
"from": "server_members",
|
"as": "members",
|
||||||
"as": "members",
|
"let": {
|
||||||
"let": {
|
"server": "$_id.server"
|
||||||
"server": "$_id.server"
|
},
|
||||||
},
|
"pipeline": [
|
||||||
"pipeline": [
|
{
|
||||||
{
|
"$match": {
|
||||||
"$match": {
|
"$expr": {
|
||||||
"$expr": {
|
"$and": [
|
||||||
"$and": [
|
{ "$eq": [ "$_id.user", user_b ] },
|
||||||
{ "$eq": [ "$_id.user", user_b ] },
|
{ "$eq": [ "$_id.server", "$$server" ] }
|
||||||
{ "$eq": [ "$_id.server", "$$server" ] }
|
]
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doc! {
|
|
||||||
"$match": {
|
|
||||||
"members": {
|
|
||||||
"$size": 1_i32
|
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doc! {
|
||||||
|
"$match": {
|
||||||
|
"members": {
|
||||||
|
"$size": 1_i32
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
doc! {
|
},
|
||||||
"$project": {
|
doc! {
|
||||||
"_id": "$_id.server"
|
"$project": {
|
||||||
}
|
"_id": "$_id.server"
|
||||||
},
|
}
|
||||||
],
|
},
|
||||||
None,
|
])
|
||||||
)
|
|
||||||
.await
|
.await
|
||||||
.map_err(|_| create_database_error!("aggregate", "server_members"))?
|
.map_err(|_| create_database_error!("aggregate", "server_members"))?
|
||||||
.filter_map(|s| async { s.ok() })
|
.filter_map(|s| async { s.ok() })
|
||||||
@@ -224,16 +212,34 @@ impl AbstractUsers for MongoDb {
|
|||||||
partial: &PartialUser,
|
partial: &PartialUser,
|
||||||
remove: Vec<FieldsUser>,
|
remove: Vec<FieldsUser>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
query!(
|
if remove.contains(&FieldsUser::StatusText) && partial.status.is_some() {
|
||||||
self,
|
// stupid-ass workaround to fix mongo conflicting the same item
|
||||||
update_one_by_id,
|
let _: Result<()> = query!(
|
||||||
COL,
|
self,
|
||||||
id,
|
update_one_by_id,
|
||||||
partial,
|
COL,
|
||||||
remove.iter().map(|x| x as &dyn IntoDocumentPath).collect(),
|
id,
|
||||||
None
|
PartialUser {
|
||||||
)
|
..Default::default()
|
||||||
.map(|_| ())
|
},
|
||||||
|
remove.iter().map(|x| x as &dyn IntoDocumentPath).collect(),
|
||||||
|
None
|
||||||
|
)
|
||||||
|
.map(|_| ());
|
||||||
|
|
||||||
|
query!(self, update_one_by_id, COL, id, partial, vec![], None).map(|_| ())
|
||||||
|
} else {
|
||||||
|
query!(
|
||||||
|
self,
|
||||||
|
update_one_by_id,
|
||||||
|
COL,
|
||||||
|
id,
|
||||||
|
partial,
|
||||||
|
remove.iter().map(|x| x as &dyn IntoDocumentPath).collect(),
|
||||||
|
None
|
||||||
|
)
|
||||||
|
.map(|_| ())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set relationship with another user
|
/// Set relationship with another user
|
||||||
@@ -284,7 +290,6 @@ impl AbstractUsers for MongoDb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -305,7 +310,6 @@ impl AbstractUsers for MongoDb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
@@ -329,11 +333,29 @@ impl AbstractUsers for MongoDb {
|
|||||||
"subscription": 1
|
"subscription": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
.map_err(|_| create_database_error!("update_one", COL))
|
.map_err(|_| create_database_error!("update_one", "sessions"))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn update_session_last_seen(&self, session_id: &str, when: Timestamp) -> Result<()> {
|
||||||
|
let formatted: &str = &when.format();
|
||||||
|
|
||||||
|
self.col::<Session>("sessions")
|
||||||
|
.update_one(
|
||||||
|
doc! {
|
||||||
|
"_id": session_id
|
||||||
|
},
|
||||||
|
doc! {
|
||||||
|
"$set": {
|
||||||
|
"last_seen": formatted
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.map(|_| ())
|
||||||
|
.map_err(|_| create_database_error!("update_one", "sessions"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
use authifier::models::Session;
|
use authifier::models::Session;
|
||||||
|
use iso8601_timestamp::Timestamp;
|
||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
|
|
||||||
use crate::{FieldsUser, PartialUser, RelationshipStatus, User};
|
use crate::{FieldsUser, PartialUser, RelationshipStatus, User};
|
||||||
@@ -168,4 +169,8 @@ impl AbstractUsers for ReferenceDb {
|
|||||||
async fn remove_push_subscription_by_session_id(&self, _session_id: &str) -> Result<()> {
|
async fn remove_push_subscription_by_session_id(&self, _session_id: &str) -> Result<()> {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn update_session_last_seen(&self, _session_id: &str, _when: Timestamp) -> Result<()> {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use revolt_rocket_okapi::{
|
|||||||
|
|
||||||
use crate::User;
|
use crate::User;
|
||||||
|
|
||||||
impl<'r> OpenApiFromRequest<'r> for User {
|
impl OpenApiFromRequest<'_> for User {
|
||||||
fn from_request_input(
|
fn from_request_input(
|
||||||
_gen: &mut OpenApiGenerator,
|
_gen: &mut OpenApiGenerator,
|
||||||
_name: String,
|
_name: String,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ use crate::{Database, Message, AMQP};
|
|||||||
|
|
||||||
use deadqueue::limited::Queue;
|
use deadqueue::limited::Queue;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
use revolt_config::capture_message;
|
||||||
use revolt_models::v0::PushNotification;
|
use revolt_models::v0::PushNotification;
|
||||||
use rocket::form::validate::Contains;
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
collections::{HashMap, HashSet},
|
||||||
time::Duration,
|
time::Duration,
|
||||||
@@ -14,6 +14,7 @@ use validator::HasLen;
|
|||||||
use revolt_result::Result;
|
use revolt_result::Result;
|
||||||
|
|
||||||
use super::DelayedTask;
|
use super::DelayedTask;
|
||||||
|
use crate::Channel::{TextChannel, VoiceChannel};
|
||||||
|
|
||||||
/// Enumeration of possible events
|
/// Enumeration of possible events
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
@@ -64,6 +65,7 @@ pub async fn queue_ack(channel: String, user: String, event: AckEvent) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Do not add more than one message per event.
|
||||||
pub async fn queue_message(channel: String, event: AckEvent) {
|
pub async fn queue_message(channel: String, event: AckEvent) {
|
||||||
Q.try_push(Data {
|
Q.try_push(Data {
|
||||||
channel,
|
channel,
|
||||||
@@ -113,40 +115,50 @@ pub async fn handle_ack_event(
|
|||||||
}
|
}
|
||||||
AckEvent::ProcessMessage { messages } => {
|
AckEvent::ProcessMessage { messages } => {
|
||||||
let mut users: HashSet<&String> = HashSet::new();
|
let mut users: HashSet<&String> = HashSet::new();
|
||||||
debug!(
|
info!(
|
||||||
"Processing {} messages from channel {}",
|
"Processing {} messages from channel {}",
|
||||||
messages.len(),
|
messages.len(),
|
||||||
messages[0].1.channel
|
messages[0].1.channel
|
||||||
);
|
);
|
||||||
|
|
||||||
// find all the users we'll be notifying
|
// find all the users we'll be notifying
|
||||||
messages
|
messages.iter().for_each(|(_, _, recipents, _)| {
|
||||||
.iter()
|
users.extend(recipents.iter());
|
||||||
.for_each(|(_, _, recipents, _)| users.extend(recipents.iter()));
|
});
|
||||||
|
|
||||||
debug!("Found {} users to notify.", users.len());
|
info!("Found {} users to notify.", users.len());
|
||||||
|
|
||||||
for user in users {
|
for user in users {
|
||||||
let message_ids: Vec<String> = messages
|
let message_ids: Vec<String> = messages
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(_, _, recipients, _)| recipients.contains(user))
|
.filter_map(|(_, message, recipients, _)| {
|
||||||
.map(|(_, message, _, _)| message.id.clone())
|
if recipients.contains(user) {
|
||||||
|
Some(message.id.clone())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if !message_ids.is_empty() {
|
if !message_ids.is_empty() {
|
||||||
db.add_mention_to_unread(channel, user, &message_ids)
|
db.add_mention_to_unread(channel, user, &message_ids)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
debug!("Added {} mentions for user {}", message_ids.len(), &user);
|
info!("Added {} mentions for user {}", message_ids.len(), &user);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (push, _, recipients, silenced) in messages {
|
let mut mass_mentions = vec![];
|
||||||
if *silenced || recipients.is_empty() || push.is_none() {
|
|
||||||
|
for (push, message, recipients, silenced) in messages {
|
||||||
|
if *silenced
|
||||||
|
|| push.is_none()
|
||||||
|
|| (recipients.is_empty() && !message.contains_mass_push_mention())
|
||||||
|
{
|
||||||
debug!(
|
debug!(
|
||||||
"Rejecting push: silenced: {}, recipient count: {}, push exists: {:?}",
|
"Rejecting push: silenced: {}, recipient count: {}, push exists: {:?}",
|
||||||
*silenced,
|
*silenced,
|
||||||
recipients.length(),
|
recipients.length(),
|
||||||
push
|
push.is_some()
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -162,6 +174,35 @@ pub async fn handle_ack_event(
|
|||||||
{
|
{
|
||||||
revolt_config::capture_error(&err);
|
revolt_config::capture_error(&err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if message.contains_mass_push_mention() {
|
||||||
|
mass_mentions.push(push.clone().unwrap());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !mass_mentions.is_empty() {
|
||||||
|
debug!(
|
||||||
|
"Sending mass mention push event to AMQP; channel {}",
|
||||||
|
&mass_mentions[0].message.channel
|
||||||
|
);
|
||||||
|
|
||||||
|
let channel = db
|
||||||
|
.fetch_channel(&mass_mentions[0].message.channel)
|
||||||
|
.await
|
||||||
|
.expect("Failed to fetch channel from db");
|
||||||
|
|
||||||
|
match channel {
|
||||||
|
TextChannel { server, .. } | VoiceChannel { server, .. } => {
|
||||||
|
if let Err(err) =
|
||||||
|
amqp.mass_mention_message_sent(server, mass_mentions).await
|
||||||
|
{
|
||||||
|
revolt_config::capture_error(&err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
panic!("Unknown channel type when sending mass mention event");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -207,6 +248,8 @@ pub async fn worker(db: Database, amqp: AMQP) {
|
|||||||
mut event,
|
mut event,
|
||||||
}) = Q.try_pop()
|
}) = Q.try_pop()
|
||||||
{
|
{
|
||||||
|
info!("Took next ack from queue, now {} remaining", Q.len());
|
||||||
|
|
||||||
let key: (Option<String>, String, u8) = (
|
let key: (Option<String>, String, u8) = (
|
||||||
user,
|
user,
|
||||||
channel,
|
channel,
|
||||||
@@ -221,18 +264,31 @@ pub async fn worker(db: Database, amqp: AMQP) {
|
|||||||
if let AckEvent::ProcessMessage { messages: existing } =
|
if let AckEvent::ProcessMessage { messages: existing } =
|
||||||
&mut task.data.event
|
&mut task.data.event
|
||||||
{
|
{
|
||||||
// add the new message to the list of messages to be processed.
|
if let Some(new_event) = new_data.pop() {
|
||||||
existing.append(new_data);
|
// if the message contains a mass mention, do not delay it any further.
|
||||||
|
if new_event.1.contains_mass_push_mention() {
|
||||||
|
// add the new message to the list of messages to be processed.
|
||||||
|
existing.push(new_event);
|
||||||
|
task.run_immediately();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// put a cap on the amount of messages that can be queued, for particularly active channels
|
existing.push(new_event);
|
||||||
if (existing.length() as u16)
|
|
||||||
< revolt_config::config()
|
// put a cap on the amount of messages that can be queued, for particularly active channels
|
||||||
.await
|
if (existing.length() as u16)
|
||||||
.features
|
< revolt_config::config()
|
||||||
.advanced
|
.await
|
||||||
.process_message_delay_limit
|
.features
|
||||||
{
|
.advanced
|
||||||
task.delay();
|
.process_message_delay_limit
|
||||||
|
{
|
||||||
|
task.delay();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let err_msg = format!("Got zero-length message event: {event:?}");
|
||||||
|
capture_message(&err_msg, revolt_config::Level::Warning);
|
||||||
|
info!("{err_msg}")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
panic!("Somehow got an ack message in the add mention arm");
|
panic!("Somehow got an ack message in the add mention arm");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use once_cell::sync::Lazy;
|
|||||||
|
|
||||||
use crate::events::client::EventV1;
|
use crate::events::client::EventV1;
|
||||||
|
|
||||||
static Q: Lazy<(Sender<AuthifierEvent>, Receiver<AuthifierEvent>)> = Lazy::new(|| unbounded());
|
static Q: Lazy<(Sender<AuthifierEvent>, Receiver<AuthifierEvent>)> = Lazy::new(unbounded);
|
||||||
|
|
||||||
/// Get sender
|
/// Get sender
|
||||||
pub fn sender() -> Sender<AuthifierEvent> {
|
pub fn sender() -> Sender<AuthifierEvent> {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ pub fn start_workers(db: Database, amqp: AMQP) {
|
|||||||
/// Task with additional information on when it should run
|
/// Task with additional information on when it should run
|
||||||
pub struct DelayedTask<T> {
|
pub struct DelayedTask<T> {
|
||||||
pub data: T,
|
pub data: T,
|
||||||
|
run_now: bool,
|
||||||
last_updated: Instant,
|
last_updated: Instant,
|
||||||
first_seen: Instant,
|
first_seen: Instant,
|
||||||
}
|
}
|
||||||
@@ -41,6 +42,7 @@ impl<T> DelayedTask<T> {
|
|||||||
pub fn new(data: T) -> Self {
|
pub fn new(data: T) -> Self {
|
||||||
DelayedTask {
|
DelayedTask {
|
||||||
data,
|
data,
|
||||||
|
run_now: false,
|
||||||
last_updated: Instant::now(),
|
last_updated: Instant::now(),
|
||||||
first_seen: Instant::now(),
|
first_seen: Instant::now(),
|
||||||
}
|
}
|
||||||
@@ -51,9 +53,15 @@ impl<T> DelayedTask<T> {
|
|||||||
self.last_updated = Instant::now()
|
self.last_updated = Instant::now()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Flag the task to run right away, regardless of the time
|
||||||
|
pub fn run_immediately(&mut self) {
|
||||||
|
self.run_now = true
|
||||||
|
}
|
||||||
|
|
||||||
/// Check if a task should run yet
|
/// Check if a task should run yet
|
||||||
pub fn should_run(&self) -> bool {
|
pub fn should_run(&self) -> bool {
|
||||||
self.first_seen.elapsed().as_secs() > EXPIRE_CONSTANT
|
self.run_now
|
||||||
|
|| self.first_seen.elapsed().as_secs() > EXPIRE_CONSTANT
|
||||||
|| self.last_updated.elapsed().as_secs() > SAVE_CONSTANT
|
|| self.last_updated.elapsed().as_secs() > SAVE_CONSTANT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
|
use iso8601_timestamp::Timestamp;
|
||||||
use revolt_models::v0::*;
|
use revolt_models::v0::*;
|
||||||
use revolt_permissions::{calculate_user_permissions, UserPermission};
|
use revolt_permissions::{calculate_user_permissions, UserPermission};
|
||||||
|
|
||||||
use crate::{util::permissions::DatabasePermissionQuery, Database, FileUsedFor};
|
use crate::{util::permissions::DatabasePermissionQuery, Database};
|
||||||
|
|
||||||
impl crate::Bot {
|
impl crate::Bot {
|
||||||
pub fn into_public_bot(self, user: crate::User) -> PublicBot {
|
pub fn into_public_bot(self, user: crate::User) -> PublicBot {
|
||||||
@@ -14,8 +15,7 @@ impl crate::Bot {
|
|||||||
avatar: user.avatar.map(|x| x.id).unwrap_or_default(),
|
avatar: user.avatar.map(|x| x.id).unwrap_or_default(),
|
||||||
description: user
|
description: user
|
||||||
.profile
|
.profile
|
||||||
.map(|profile| profile.content)
|
.and_then(|profile| profile.content)
|
||||||
.flatten()
|
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -483,11 +483,12 @@ impl crate::Message {
|
|||||||
edited: self.edited,
|
edited: self.edited,
|
||||||
embeds: self.embeds,
|
embeds: self.embeds,
|
||||||
mentions: self.mentions,
|
mentions: self.mentions,
|
||||||
|
role_mentions: self.role_mentions,
|
||||||
replies: self.replies,
|
replies: self.replies,
|
||||||
reactions: self.reactions,
|
reactions: self.reactions,
|
||||||
interactions: self.interactions.into(),
|
interactions: self.interactions.into(),
|
||||||
masquerade: self.masquerade.map(Into::into),
|
masquerade: self.masquerade.map(Into::into),
|
||||||
flags: self.flags.map(|flags| flags as u32).unwrap_or_default(),
|
flags: self.flags.unwrap_or_default(),
|
||||||
pinned: self.pinned,
|
pinned: self.pinned,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -511,11 +512,12 @@ impl From<crate::PartialMessage> for PartialMessage {
|
|||||||
edited: value.edited,
|
edited: value.edited,
|
||||||
embeds: value.embeds,
|
embeds: value.embeds,
|
||||||
mentions: value.mentions,
|
mentions: value.mentions,
|
||||||
|
role_mentions: value.role_mentions,
|
||||||
replies: value.replies,
|
replies: value.replies,
|
||||||
reactions: value.reactions,
|
reactions: value.reactions,
|
||||||
interactions: value.interactions.map(Into::into),
|
interactions: value.interactions.map(Into::into),
|
||||||
masquerade: value.masquerade.map(Into::into),
|
masquerade: value.masquerade.map(Into::into),
|
||||||
flags: value.flags.map(|flags| flags as u32),
|
flags: value.flags,
|
||||||
pinned: value.pinned,
|
pinned: value.pinned,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -595,6 +597,17 @@ impl From<Masquerade> for crate::Masquerade {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<crate::PolicyChange> for PolicyChange {
|
||||||
|
fn from(value: crate::PolicyChange) -> Self {
|
||||||
|
PolicyChange {
|
||||||
|
created_time: value.created_time,
|
||||||
|
effective_time: value.effective_time,
|
||||||
|
description: value.description,
|
||||||
|
url: value.url,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<crate::Report> for Report {
|
impl From<crate::Report> for Report {
|
||||||
fn from(value: crate::Report) -> Self {
|
fn from(value: crate::Report) -> Self {
|
||||||
Report {
|
Report {
|
||||||
@@ -992,6 +1005,8 @@ impl crate::User {
|
|||||||
(RelationshipStatus::None, false)
|
(RelationshipStatus::None, false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let badges = self.get_badges().await;
|
||||||
|
|
||||||
User {
|
User {
|
||||||
username: self.username,
|
username: self.username,
|
||||||
discriminator: self.discriminator,
|
discriminator: self.discriminator,
|
||||||
@@ -1010,7 +1025,7 @@ impl crate::User {
|
|||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
},
|
},
|
||||||
badges: self.badges.unwrap_or_default() as u32,
|
badges,
|
||||||
online: can_see_profile
|
online: can_see_profile
|
||||||
&& revolt_presence::is_online(&self.id).await
|
&& revolt_presence::is_online(&self.id).await
|
||||||
&& !matches!(
|
&& !matches!(
|
||||||
@@ -1021,7 +1036,7 @@ impl crate::User {
|
|||||||
})
|
})
|
||||||
),
|
),
|
||||||
status: if can_see_profile {
|
status: if can_see_profile {
|
||||||
self.status.map(|status| status.into())
|
self.status.and_then(|status| status.into(true))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
@@ -1036,7 +1051,7 @@ impl crate::User {
|
|||||||
/// Convert user object into user model assuming mutual connection
|
/// Convert user object into user model assuming mutual connection
|
||||||
///
|
///
|
||||||
/// Relations will never be included, i.e. when we process ourselves
|
/// Relations will never be included, i.e. when we process ourselves
|
||||||
pub fn into_known<'a, P>(self, perspective: P, is_online: bool) -> User
|
pub async fn into_known<'a, P>(self, perspective: P, is_online: bool) -> User
|
||||||
where
|
where
|
||||||
P: Into<Option<&'a crate::User>>,
|
P: Into<Option<&'a crate::User>>,
|
||||||
{
|
{
|
||||||
@@ -1066,13 +1081,15 @@ impl crate::User {
|
|||||||
(RelationshipStatus::None, false)
|
(RelationshipStatus::None, false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let badges = self.get_badges().await;
|
||||||
|
|
||||||
User {
|
User {
|
||||||
username: self.username,
|
username: self.username,
|
||||||
discriminator: self.discriminator,
|
discriminator: self.discriminator,
|
||||||
display_name: self.display_name,
|
display_name: self.display_name,
|
||||||
avatar: self.avatar.map(|file| file.into()),
|
avatar: self.avatar.map(|file| file.into()),
|
||||||
relations: vec![],
|
relations: vec![],
|
||||||
badges: self.badges.unwrap_or_default() as u32,
|
badges,
|
||||||
online: can_see_profile
|
online: can_see_profile
|
||||||
&& is_online
|
&& is_online
|
||||||
&& !matches!(
|
&& !matches!(
|
||||||
@@ -1083,7 +1100,7 @@ impl crate::User {
|
|||||||
})
|
})
|
||||||
),
|
),
|
||||||
status: if can_see_profile {
|
status: if can_see_profile {
|
||||||
self.status.map(|status| status.into())
|
self.status.and_then(|status| status.into(true))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
@@ -1096,14 +1113,16 @@ impl crate::User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Convert user object into user model without presence information
|
/// Convert user object into user model without presence information
|
||||||
pub fn into_known_static<'a>(self, is_online: bool) -> User {
|
pub async fn into_known_static(self, is_online: bool) -> User {
|
||||||
|
let badges = self.get_badges().await;
|
||||||
|
|
||||||
User {
|
User {
|
||||||
username: self.username,
|
username: self.username,
|
||||||
discriminator: self.discriminator,
|
discriminator: self.discriminator,
|
||||||
display_name: self.display_name,
|
display_name: self.display_name,
|
||||||
avatar: self.avatar.map(|file| file.into()),
|
avatar: self.avatar.map(|file| file.into()),
|
||||||
relations: vec![],
|
relations: vec![],
|
||||||
badges: self.badges.unwrap_or_default() as u32,
|
badges,
|
||||||
online: is_online
|
online: is_online
|
||||||
&& !matches!(
|
&& !matches!(
|
||||||
self.status,
|
self.status,
|
||||||
@@ -1112,7 +1131,7 @@ impl crate::User {
|
|||||||
..
|
..
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
status: self.status.map(|status| status.into()),
|
status: self.status.and_then(|status| status.into(true)),
|
||||||
flags: self.flags.unwrap_or_default() as u32,
|
flags: self.flags.unwrap_or_default() as u32,
|
||||||
privileged: self.privileged,
|
privileged: self.privileged,
|
||||||
bot: self.bot.map(|bot| bot.into()),
|
bot: self.bot.map(|bot| bot.into()),
|
||||||
@@ -1122,6 +1141,8 @@ impl crate::User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn into_self(self, force_online: bool) -> User {
|
pub async fn into_self(self, force_online: bool) -> User {
|
||||||
|
let badges = self.get_badges().await;
|
||||||
|
|
||||||
User {
|
User {
|
||||||
username: self.username,
|
username: self.username,
|
||||||
discriminator: self.discriminator,
|
discriminator: self.discriminator,
|
||||||
@@ -1136,7 +1157,7 @@ impl crate::User {
|
|||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
badges: self.badges.unwrap_or_default() as u32,
|
badges,
|
||||||
online: (force_online || revolt_presence::is_online(&self.id).await)
|
online: (force_online || revolt_presence::is_online(&self.id).await)
|
||||||
&& !matches!(
|
&& !matches!(
|
||||||
self.status,
|
self.status,
|
||||||
@@ -1145,7 +1166,7 @@ impl crate::User {
|
|||||||
..
|
..
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
status: self.status.map(|status| status.into()),
|
status: self.status.and_then(|status| status.into(true)),
|
||||||
flags: self.flags.unwrap_or_default() as u32,
|
flags: self.flags.unwrap_or_default() as u32,
|
||||||
privileged: self.privileged,
|
privileged: self.privileged,
|
||||||
bot: self.bot.map(|bot| bot.into()),
|
bot: self.bot.map(|bot| bot.into()),
|
||||||
@@ -1178,6 +1199,7 @@ impl From<User> for crate::User {
|
|||||||
privileged: value.privileged,
|
privileged: value.privileged,
|
||||||
bot: value.bot.map(Into::into),
|
bot: value.bot.map(Into::into),
|
||||||
suspended_until: None,
|
suspended_until: None,
|
||||||
|
last_acknowledged_policy_change: Timestamp::UNIX_EPOCH,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1196,7 +1218,7 @@ impl From<crate::PartialUser> for PartialUser {
|
|||||||
.collect()
|
.collect()
|
||||||
}),
|
}),
|
||||||
badges: value.badges.map(|badges| badges as u32),
|
badges: value.badges.map(|badges| badges as u32),
|
||||||
status: value.status.map(|status| status.into()),
|
status: value.status.and_then(|status| status.into(false)),
|
||||||
flags: value.flags.map(|flags| flags as u32),
|
flags: value.flags.map(|flags| flags as u32),
|
||||||
privileged: value.privileged,
|
privileged: value.privileged,
|
||||||
bot: value.bot.map(|bot| bot.into()),
|
bot: value.bot.map(|bot| bot.into()),
|
||||||
@@ -1285,11 +1307,23 @@ impl From<Presence> for crate::Presence {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<crate::UserStatus> for UserStatus {
|
impl crate::UserStatus {
|
||||||
fn from(value: crate::UserStatus) -> Self {
|
fn into(self, discard_invisible: bool) -> Option<UserStatus> {
|
||||||
UserStatus {
|
let status = UserStatus {
|
||||||
text: value.text,
|
text: self.text,
|
||||||
presence: value.presence.map(|presence| presence.into()),
|
presence: self.presence.and_then(|presence| {
|
||||||
|
if discard_invisible && presence == crate::Presence::Invisible {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(presence.into())
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
|
||||||
|
if status.text.is_none() && status.presence.is_none() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,23 +87,46 @@ impl<'z> BulkDatabasePermissionQuery<'z> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn channel(self, channel: &'z Channel) -> BulkDatabasePermissionQuery {
|
pub fn channel(self, channel: &'z Channel) -> BulkDatabasePermissionQuery<'z> {
|
||||||
BulkDatabasePermissionQuery {
|
BulkDatabasePermissionQuery {
|
||||||
channel: Some(channel.clone()),
|
channel: Some(channel.clone()),
|
||||||
..self
|
..self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn members(self, members: &'z [Member]) -> BulkDatabasePermissionQuery {
|
pub async fn from_channel_id(self, channel_id: String) -> BulkDatabasePermissionQuery<'z> {
|
||||||
|
let channel = self
|
||||||
|
.database
|
||||||
|
.fetch_channel(channel_id.as_str())
|
||||||
|
.await
|
||||||
|
.expect("Valid channel id");
|
||||||
|
|
||||||
|
drop(channel_id);
|
||||||
|
|
||||||
BulkDatabasePermissionQuery {
|
BulkDatabasePermissionQuery {
|
||||||
members: Some(members.to_owned()),
|
channel: Some(channel),
|
||||||
..self
|
..self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn users(self, users: &'z [User]) -> BulkDatabasePermissionQuery {
|
pub fn members(self, members: &'z [Member]) -> BulkDatabasePermissionQuery<'z> {
|
||||||
|
BulkDatabasePermissionQuery {
|
||||||
|
members: Some(members.to_owned()),
|
||||||
|
cached_member_perms: None,
|
||||||
|
users: None,
|
||||||
|
cached_members: None,
|
||||||
|
cached_users: None,
|
||||||
|
..self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn users(self, users: &'z [User]) -> BulkDatabasePermissionQuery<'z> {
|
||||||
BulkDatabasePermissionQuery {
|
BulkDatabasePermissionQuery {
|
||||||
users: Some(users.to_owned()),
|
users: Some(users.to_owned()),
|
||||||
|
cached_member_perms: None,
|
||||||
|
members: None,
|
||||||
|
cached_members: None,
|
||||||
|
cached_users: None,
|
||||||
..self
|
..self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ use revolt_rocket_okapi::{
|
|||||||
use schemars::schema::{InstanceType, SchemaObject, SingleOrVec};
|
use schemars::schema::{InstanceType, SchemaObject, SingleOrVec};
|
||||||
|
|
||||||
#[cfg(feature = "rocket-impl")]
|
#[cfg(feature = "rocket-impl")]
|
||||||
impl<'r> OpenApiFromRequest<'r> for IdempotencyKey {
|
impl OpenApiFromRequest<'_> for IdempotencyKey {
|
||||||
fn from_request_input(
|
fn from_request_input(
|
||||||
_gen: &mut OpenApiGenerator,
|
_gen: &mut OpenApiGenerator,
|
||||||
_name: String,
|
_name: String,
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ impl PermissionQuery for DatabasePermissionQuery<'_> {
|
|||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
self.cached_mutual_connection = Some(value);
|
self.cached_mutual_connection = Some(value);
|
||||||
matches!(value, true)
|
value
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
@@ -305,16 +305,14 @@ impl PermissionQuery for DatabasePermissionQuery<'_> {
|
|||||||
|
|
||||||
/// Are we a recipient of this channel?
|
/// Are we a recipient of this channel?
|
||||||
async fn are_we_part_of_the_channel(&mut self) -> bool {
|
async fn are_we_part_of_the_channel(&mut self) -> bool {
|
||||||
if let Some(channel) = &self.channel {
|
if let Some(
|
||||||
match channel {
|
Cow::Borrowed(Channel::DirectMessage { recipients, .. })
|
||||||
Cow::Borrowed(Channel::DirectMessage { recipients, .. })
|
| Cow::Owned(Channel::DirectMessage { recipients, .. })
|
||||||
| Cow::Owned(Channel::DirectMessage { recipients, .. })
|
| Cow::Borrowed(Channel::Group { recipients, .. })
|
||||||
| Cow::Borrowed(Channel::Group { recipients, .. })
|
| Cow::Owned(Channel::Group { recipients, .. }),
|
||||||
| Cow::Owned(Channel::Group { recipients, .. }) => {
|
) = &self.channel
|
||||||
recipients.contains(&self.perspective.id)
|
{
|
||||||
}
|
recipients.contains(&self.perspective.id)
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
@@ -420,7 +418,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use user
|
/// Use user
|
||||||
pub fn user(self, user: &'a User) -> DatabasePermissionQuery {
|
pub fn user(self, user: &'a User) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
user: Some(Cow::Borrowed(user)),
|
user: Some(Cow::Borrowed(user)),
|
||||||
..self
|
..self
|
||||||
@@ -428,7 +426,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use channel
|
/// Use channel
|
||||||
pub fn channel(self, channel: &'a Channel) -> DatabasePermissionQuery {
|
pub fn channel(self, channel: &'a Channel) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
channel: Some(Cow::Borrowed(channel)),
|
channel: Some(Cow::Borrowed(channel)),
|
||||||
..self
|
..self
|
||||||
@@ -436,7 +434,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use server
|
/// Use server
|
||||||
pub fn server(self, server: &'a Server) -> DatabasePermissionQuery {
|
pub fn server(self, server: &'a Server) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
server: Some(Cow::Borrowed(server)),
|
server: Some(Cow::Borrowed(server)),
|
||||||
..self
|
..self
|
||||||
@@ -444,7 +442,7 @@ impl<'a> DatabasePermissionQuery<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use member
|
/// Use member
|
||||||
pub fn member(self, member: &'a Member) -> DatabasePermissionQuery {
|
pub fn member(self, member: &'a Member) -> DatabasePermissionQuery<'a> {
|
||||||
DatabasePermissionQuery {
|
DatabasePermissionQuery {
|
||||||
member: Some(Cow::Borrowed(member)),
|
member: Some(Cow::Borrowed(member)),
|
||||||
..self
|
..self
|
||||||
|
|||||||
@@ -1,464 +1,93 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<!-- Compiled with Bootstrap Email version: 1.3.1 -->
|
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
<meta name="x-apple-disable-message-reformatting">
|
||||||
<meta name="x-apple-disable-message-reformatting" />
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||||
<meta
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
name="format-detection"
|
|
||||||
content="telephone=no, date=no, address=no, email=no"
|
|
||||||
/>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body,
|
body,table,td{font-family:Helvetica,Arial,sans-serif !important}.ExternalClass{width:100%}.ExternalClass,.ExternalClass p,.ExternalClass span,.ExternalClass font,.ExternalClass td,.ExternalClass div{line-height:150%}a{text-decoration:none}*{color:inherit}a[x-apple-data-detectors],u+#body a,#MessageViewBody a{color:inherit;text-decoration:none;font-size:inherit;font-family:inherit;font-weight:inherit;line-height:inherit}img{-ms-interpolation-mode:bicubic}table:not([class^=s-]){font-family:Helvetica,Arial,sans-serif;mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;border-collapse:collapse}table:not([class^=s-]) td{border-spacing:0px;border-collapse:collapse}@media screen and (max-width: 600px){.w-full,.w-full>tbody>tr>td{width:100% !important}.w-24,.w-24>tbody>tr>td{width:96px !important}.p-lg-10:not(table),.p-lg-10:not(.btn)>tbody>tr>td,.p-lg-10.btn td a{padding:0 !important}.p-3:not(table),.p-3:not(.btn)>tbody>tr>td,.p-3.btn td a{padding:12px !important}.p-6:not(table),.p-6:not(.btn)>tbody>tr>td,.p-6.btn td a{padding:24px !important}*[class*=s-lg-]>tbody>tr>td{font-size:0 !important;line-height:0 !important;height:0 !important}.s-4>tbody>tr>td{font-size:16px !important;line-height:16px !important;height:16px !important}.s-6>tbody>tr>td{font-size:24px !important;line-height:24px !important;height:24px !important}.s-10>tbody>tr>td{font-size:40px !important;line-height:40px !important;height:40px !important}}
|
||||||
table,
|
|
||||||
td {
|
|
||||||
font-family: Helvetica, Arial, sans-serif !important;
|
|
||||||
}
|
|
||||||
.ExternalClass {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.ExternalClass,
|
|
||||||
.ExternalClass p,
|
|
||||||
.ExternalClass span,
|
|
||||||
.ExternalClass font,
|
|
||||||
.ExternalClass td,
|
|
||||||
.ExternalClass div {
|
|
||||||
line-height: 150%;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
a[x-apple-data-detectors],
|
|
||||||
u + #body a,
|
|
||||||
#MessageViewBody a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: inherit;
|
|
||||||
font-family: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
-ms-interpolation-mode: bicubic;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) {
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
mso-table-lspace: 0pt;
|
|
||||||
mso-table-rspace: 0pt;
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) td {
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
.w-full,
|
|
||||||
.w-full > tbody > tr > td {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
.w-24,
|
|
||||||
.w-24 > tbody > tr > td {
|
|
||||||
width: 96px !important;
|
|
||||||
}
|
|
||||||
.p-lg-10:not(table),
|
|
||||||
.p-lg-10:not(.btn) > tbody > tr > td,
|
|
||||||
.p-lg-10.btn td a {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
.p-3:not(table),
|
|
||||||
.p-3:not(.btn) > tbody > tr > td,
|
|
||||||
.p-3.btn td a {
|
|
||||||
padding: 12px !important;
|
|
||||||
}
|
|
||||||
.p-6:not(table),
|
|
||||||
.p-6:not(.btn) > tbody > tr > td,
|
|
||||||
.p-6.btn td a {
|
|
||||||
padding: 24px !important;
|
|
||||||
}
|
|
||||||
*[class*="s-lg-"] > tbody > tr > td {
|
|
||||||
font-size: 0 !important;
|
|
||||||
line-height: 0 !important;
|
|
||||||
height: 0 !important;
|
|
||||||
}
|
|
||||||
.s-4 > tbody > tr > td {
|
|
||||||
font-size: 16px !important;
|
|
||||||
line-height: 16px !important;
|
|
||||||
height: 16px !important;
|
|
||||||
}
|
|
||||||
.s-6 > tbody > tr > td {
|
|
||||||
font-size: 24px !important;
|
|
||||||
line-height: 24px !important;
|
|
||||||
height: 24px !important;
|
|
||||||
}
|
|
||||||
.s-10 > tbody > tr > td {
|
|
||||||
font-size: 40px !important;
|
|
||||||
line-height: 40px !important;
|
|
||||||
height: 40px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body class="bg-light" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
class="bg-light"
|
<table class="bg-light body" valign="top" role="presentation" border="0" cellpadding="0" cellspacing="0" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="bg-light body"
|
|
||||||
valign="top"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td valign="top" style="line-height: 24px; font-size: 16px; margin: 0;" align="left" bgcolor="#f7fafc">
|
||||||
valign="top"
|
<table class="container" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||||
style="line-height: 24px; font-size: 16px; margin: 0"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="container"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td align="center" style="line-height: 24px; font-size: 16px; margin: 0; padding: 0 16px;">
|
||||||
align="center"
|
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 16px;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<!--[if (gte mso 9)|(IE)]>
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
<table align="center" role="presentation">
|
<table align="center" role="presentation">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="600">
|
<td width="600">
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<table
|
<table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px; margin: 0 auto;">
|
||||||
align="center"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%; max-width: 600px; margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
class="ax-center"
|
|
||||||
role="presentation"
|
|
||||||
align="center"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<img alt="Revolt Logo" class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
alt="Revolt Logo"
|
|
||||||
class="w-24"
|
|
||||||
src="https://app.revolt.chat/assets/logo_round.png"
|
|
||||||
style="
|
|
||||||
height: auto;
|
|
||||||
line-height: 100%;
|
|
||||||
outline: none;
|
|
||||||
text-decoration: none;
|
|
||||||
display: block;
|
|
||||||
width: 96px;
|
|
||||||
border-style: none;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
width="96"
|
|
||||||
/>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="card p-6 p-lg-10 space-y-4" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; width: 100%; overflow: hidden; border: 1px solid #e2e8f0;" bgcolor="#ffffff">
|
||||||
class="card p-6 p-lg-10 space-y-4"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
border-radius: 6px;
|
|
||||||
border-collapse: separate !important;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; width: 100%; margin: 0; padding: 40px;" align="left" bgcolor="#ffffff">
|
||||||
style="
|
<h1 class="h3 fw-700" style="padding-top: 0; padding-bottom: 0; font-weight: 700 !important; vertical-align: baseline; font-size: 28px; line-height: 33.6px; margin: 0;" align="left">Account Deletion</h1>
|
||||||
line-height: 24px;
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 40px;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<h1
|
|
||||||
class="h3 fw-700"
|
|
||||||
style="
|
|
||||||
padding-top: 0;
|
|
||||||
padding-bottom: 0;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
vertical-align: baseline;
|
|
||||||
font-size: 28px;
|
|
||||||
line-height: 33.6px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
Account Deletion
|
|
||||||
</h1>
|
|
||||||
<table
|
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">
|
||||||
class=""
|
You requested to have your account deleted, if you did not perform
|
||||||
style="
|
this action please take measures to secure your account immediately.
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
You requested to have your account
|
|
||||||
deleted, if you did not perform this
|
|
||||||
action please take measures to secure your
|
|
||||||
account immediately.
|
|
||||||
</p>
|
</p>
|
||||||
<table
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="btn btn-primary p-3 fw-700" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; font-weight: 700 !important;">
|
||||||
class="btn btn-primary p-3 fw-700"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
border-radius: 6px;
|
|
||||||
border-collapse: separate !important;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; font-weight: 700 !important; margin: 0;" align="center" bgcolor="#0d6efd">
|
||||||
style="
|
<a href="{{url}}" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: block; font-weight: 700 !important; white-space: nowrap; background-color: #0d6efd; padding: 12px; border: 1px solid #0d6efd;">Confirm</a>
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="center"
|
|
||||||
bgcolor="#0d6efd"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href="{{url}}"
|
|
||||||
style="
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: Helvetica, Arial,
|
|
||||||
sans-serif;
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 6px;
|
|
||||||
line-height: 20px;
|
|
||||||
display: block;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
white-space: nowrap;
|
|
||||||
background-color: #0d6efd;
|
|
||||||
padding: 12px;
|
|
||||||
border: 1px solid #0d6efd;
|
|
||||||
"
|
|
||||||
>Confirm</a
|
|
||||||
>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -467,66 +96,58 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 24px;
|
|
||||||
width: 100%;
|
|
||||||
height: 24px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="24"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div
|
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||||
class="text-muted text-center"
|
This email is intended for {{email}}<br>
|
||||||
style="color: #718096"
|
Sent from Revolt<br>
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
This email is intended for {{email}}<br />
|
|
||||||
Sent from Revolt<br />
|
|
||||||
Made in Europe
|
Made in Europe
|
||||||
</div>
|
</div>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
 
|
||||||
line-height: 24px;
|
</td>
|
||||||
font-size: 24px;
|
</tr>
|
||||||
width: 100%;
|
</tbody>
|
||||||
height: 24px;
|
</table>
|
||||||
margin: 0;
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
"
|
<tbody>
|
||||||
align="left"
|
<tr>
|
||||||
width="100%"
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
height="24"
|
 
|
||||||
>
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<div class="text-muted text-xs" style="color: #718096; font-size: 12px; line-height: 14.4px;">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br>
|
||||||
|
Registered Company Number: 16260658<br>
|
||||||
|
Registered Office:<br>
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br>
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -25,6 +25,14 @@
|
|||||||
Sent from Revolt<br />
|
Sent from Revolt<br />
|
||||||
Made in Europe
|
Made in Europe
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-muted text-xs my-6 ax-center">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br />
|
||||||
|
Registered Company Number: 16260658<br />
|
||||||
|
Registered Office:<br />
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -5,3 +5,10 @@ Please navigate to: {{url}}
|
|||||||
This email is intended for {{email}}
|
This email is intended for {{email}}
|
||||||
Sent by Revolt
|
Sent by Revolt
|
||||||
Made in Europe
|
Made in Europe
|
||||||
|
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||||
|
|
||||||
|
Registration Number: 16260658
|
||||||
|
Registered Office:
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
You requested to have your account deleted, if you did not perform this action please take measures to secure your account immediately.
|
||||||
|
|
||||||
|
Please navigate to: {{url}}
|
||||||
|
|
||||||
|
This email is intended for {{email}}
|
||||||
|
|
||||||
|
This email has no association with Revolt or Revolt Platforms Ltd.
|
||||||
|
Learn more about third party instances here:
|
||||||
|
https://developers.revolt.chat/faq.html
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<style>
|
||||||
|
/* Add custom classes and styles that you want inlined here */
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="bg-light">
|
||||||
|
<div class="container">
|
||||||
|
<img
|
||||||
|
alt="Revolt Logo"
|
||||||
|
class="ax-center my-10 w-24"
|
||||||
|
src="https://app.revolt.chat/assets/logo_round.png"
|
||||||
|
/>
|
||||||
|
<div class="card p-6 p-lg-10 space-y-4">
|
||||||
|
<h1 class="h3 fw-700">Notice of Terms & Policy Change</h1>
|
||||||
|
<p>
|
||||||
|
This email is to notify you that we're updating all of our policy
|
||||||
|
documents.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
You can read our updated Terms of Service and Privacy Policy below:<br />
|
||||||
|
Effective. 24th March 2025
|
||||||
|
</p>
|
||||||
|
<a class="p-3 fw-700" href="https://revolt.chat/terms"
|
||||||
|
>Terms of Service</a
|
||||||
|
>
|
||||||
|
<a class="p-3 fw-700" href="https://revolt.chat/terms"
|
||||||
|
>Privacy Policy</a
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
Our Community Guidelines have also been updated to help us better
|
||||||
|
protect and safeguard the platform. You can check them out here:
|
||||||
|
</p>
|
||||||
|
<a class="p-3 fw-700" href="https://revolt.chat/terms"
|
||||||
|
>Community Guidelines</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="text-muted text-center my-6">
|
||||||
|
Sent by Revolt<br />
|
||||||
|
Made in Europe
|
||||||
|
</div>
|
||||||
|
<div class="text-muted text-xs my-6 ax-center">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br />
|
||||||
|
Registered Company Number: 16260658<br />
|
||||||
|
Registered Office:<br />
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
<meta name="x-apple-disable-message-reformatting">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<style type="text/css">
|
||||||
|
body,table,td{font-family:Helvetica,Arial,sans-serif !important}.ExternalClass{width:100%}.ExternalClass,.ExternalClass p,.ExternalClass span,.ExternalClass font,.ExternalClass td,.ExternalClass div{line-height:150%}a{text-decoration:none}*{color:inherit}a[x-apple-data-detectors],u+#body a,#MessageViewBody a{color:inherit;text-decoration:none;font-size:inherit;font-family:inherit;font-weight:inherit;line-height:inherit}img{-ms-interpolation-mode:bicubic}table:not([class^=s-]){font-family:Helvetica,Arial,sans-serif;mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;border-collapse:collapse}table:not([class^=s-]) td{border-spacing:0px;border-collapse:collapse}@media screen and (max-width: 600px){.w-full,.w-full>tbody>tr>td{width:100% !important}.w-24,.w-24>tbody>tr>td{width:96px !important}.p-lg-10:not(table),.p-lg-10:not(.btn)>tbody>tr>td,.p-lg-10.btn td a{padding:0 !important}.p-3:not(table),.p-3:not(.btn)>tbody>tr>td,.p-3.btn td a{padding:12px !important}.p-6:not(table),.p-6:not(.btn)>tbody>tr>td,.p-6.btn td a{padding:24px !important}*[class*=s-lg-]>tbody>tr>td{font-size:0 !important;line-height:0 !important;height:0 !important}.s-4>tbody>tr>td{font-size:16px !important;line-height:16px !important;height:16px !important}.s-6>tbody>tr>td{font-size:24px !important;line-height:24px !important;height:24px !important}.s-10>tbody>tr>td{font-size:40px !important;line-height:40px !important;height:40px !important}}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="bg-light" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
|
<table class="bg-light body" valign="top" role="presentation" border="0" cellpadding="0" cellspacing="0" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td valign="top" style="line-height: 24px; font-size: 16px; margin: 0;" align="left" bgcolor="#f7fafc">
|
||||||
|
<table class="container" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td align="center" style="line-height: 24px; font-size: 16px; margin: 0; padding: 0 16px;">
|
||||||
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
|
<table align="center" role="presentation">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="600">
|
||||||
|
<![endif]-->
|
||||||
|
<table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px; margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<img class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="card p-6 p-lg-10 space-y-4" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; width: 100%; overflow: hidden; border: 1px solid #e2e8f0;" bgcolor="#ffffff">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; width: 100%; margin: 0; padding: 40px;" align="left" bgcolor="#ffffff">
|
||||||
|
<h1 class="h3 fw-700" style="padding-top: 0; padding-bottom: 0; font-weight: 700 !important; vertical-align: baseline; font-size: 28px; line-height: 33.6px; margin: 0;" align="left">Password Reset</h1>
|
||||||
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">
|
||||||
|
You tried to create a new account with or try to re-verify this email
|
||||||
|
but there is already an existing verified account under this email.
|
||||||
|
</p>
|
||||||
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">
|
||||||
|
If you wish, you can now proceed to reset the password on it, click
|
||||||
|
below to continue.
|
||||||
|
</p>
|
||||||
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="btn btn-primary p-3 fw-700" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; font-weight: 700 !important;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; font-weight: 700 !important; margin: 0;" align="center" bgcolor="#0d6efd">
|
||||||
|
<a href="{{url}}" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: block; font-weight: 700 !important; white-space: nowrap; background-color: #0d6efd; padding: 12px; border: 1px solid #0d6efd;">Reset</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||||
|
This email is intended for {{email}}<br>
|
||||||
|
Sent from Revolt<br>
|
||||||
|
Made in Europe
|
||||||
|
</div>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<div class="text-muted text-xs" style="color: #718096; font-size: 12px; line-height: 14.4px;">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br>
|
||||||
|
Registered Company Number: 16260658<br>
|
||||||
|
Registered Office:<br>
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br>
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
|
 
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<style>
|
||||||
|
/* Add custom classes and styles that you want inlined here */
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="bg-light">
|
||||||
|
<div class="container">
|
||||||
|
<img
|
||||||
|
class="ax-center my-10 w-24"
|
||||||
|
src="https://app.revolt.chat/assets/logo_round.png"
|
||||||
|
/>
|
||||||
|
<div class="card p-6 p-lg-10 space-y-4">
|
||||||
|
<h1 class="h3 fw-700">Password Reset</h1>
|
||||||
|
<p>
|
||||||
|
You tried to create a new account with or try to re-verify this email
|
||||||
|
but there is already an existing verified account under this email.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
If you wish, you can now proceed to reset the password on it, click
|
||||||
|
below to continue.
|
||||||
|
</p>
|
||||||
|
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Reset</a>
|
||||||
|
</div>
|
||||||
|
<div class="text-muted text-center my-6">
|
||||||
|
This email is intended for {{email}}<br />
|
||||||
|
Sent from Revolt<br />
|
||||||
|
Made in Europe
|
||||||
|
</div>
|
||||||
|
<div class="text-muted text-xs my-6 ax-center">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br />
|
||||||
|
Registered Company Number: 16260658<br />
|
||||||
|
Registered Office:<br />
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
You tried to create a new account with or try
|
||||||
|
to re-verify this email but there is already
|
||||||
|
an existing verified account under this email.
|
||||||
|
|
||||||
|
If you wish, you can now proceed to reset the
|
||||||
|
password on it, click below to continue.
|
||||||
|
|
||||||
|
Please navigate to: {{url}}
|
||||||
|
|
||||||
|
This email is intended for {{email}}
|
||||||
|
Sent by Revolt
|
||||||
|
Made in Europe
|
||||||
|
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||||
|
|
||||||
|
Registration Number: 16260658
|
||||||
|
Registered Office:
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
@@ -1,462 +1,90 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<!-- Compiled with Bootstrap Email version: 1.3.1 -->
|
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
<meta name="x-apple-disable-message-reformatting">
|
||||||
<meta name="x-apple-disable-message-reformatting" />
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||||
<meta
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
name="format-detection"
|
|
||||||
content="telephone=no, date=no, address=no, email=no"
|
|
||||||
/>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body,
|
body,table,td{font-family:Helvetica,Arial,sans-serif !important}.ExternalClass{width:100%}.ExternalClass,.ExternalClass p,.ExternalClass span,.ExternalClass font,.ExternalClass td,.ExternalClass div{line-height:150%}a{text-decoration:none}*{color:inherit}a[x-apple-data-detectors],u+#body a,#MessageViewBody a{color:inherit;text-decoration:none;font-size:inherit;font-family:inherit;font-weight:inherit;line-height:inherit}img{-ms-interpolation-mode:bicubic}table:not([class^=s-]){font-family:Helvetica,Arial,sans-serif;mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;border-collapse:collapse}table:not([class^=s-]) td{border-spacing:0px;border-collapse:collapse}@media screen and (max-width: 600px){.w-full,.w-full>tbody>tr>td{width:100% !important}.w-24,.w-24>tbody>tr>td{width:96px !important}.p-lg-10:not(table),.p-lg-10:not(.btn)>tbody>tr>td,.p-lg-10.btn td a{padding:0 !important}.p-3:not(table),.p-3:not(.btn)>tbody>tr>td,.p-3.btn td a{padding:12px !important}.p-6:not(table),.p-6:not(.btn)>tbody>tr>td,.p-6.btn td a{padding:24px !important}*[class*=s-lg-]>tbody>tr>td{font-size:0 !important;line-height:0 !important;height:0 !important}.s-4>tbody>tr>td{font-size:16px !important;line-height:16px !important;height:16px !important}.s-6>tbody>tr>td{font-size:24px !important;line-height:24px !important;height:24px !important}.s-10>tbody>tr>td{font-size:40px !important;line-height:40px !important;height:40px !important}}
|
||||||
table,
|
|
||||||
td {
|
|
||||||
font-family: Helvetica, Arial, sans-serif !important;
|
|
||||||
}
|
|
||||||
.ExternalClass {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.ExternalClass,
|
|
||||||
.ExternalClass p,
|
|
||||||
.ExternalClass span,
|
|
||||||
.ExternalClass font,
|
|
||||||
.ExternalClass td,
|
|
||||||
.ExternalClass div {
|
|
||||||
line-height: 150%;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
a[x-apple-data-detectors],
|
|
||||||
u + #body a,
|
|
||||||
#MessageViewBody a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: inherit;
|
|
||||||
font-family: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
-ms-interpolation-mode: bicubic;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) {
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
mso-table-lspace: 0pt;
|
|
||||||
mso-table-rspace: 0pt;
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) td {
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
.w-full,
|
|
||||||
.w-full > tbody > tr > td {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
.w-24,
|
|
||||||
.w-24 > tbody > tr > td {
|
|
||||||
width: 96px !important;
|
|
||||||
}
|
|
||||||
.p-lg-10:not(table),
|
|
||||||
.p-lg-10:not(.btn) > tbody > tr > td,
|
|
||||||
.p-lg-10.btn td a {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
.p-3:not(table),
|
|
||||||
.p-3:not(.btn) > tbody > tr > td,
|
|
||||||
.p-3.btn td a {
|
|
||||||
padding: 12px !important;
|
|
||||||
}
|
|
||||||
.p-6:not(table),
|
|
||||||
.p-6:not(.btn) > tbody > tr > td,
|
|
||||||
.p-6.btn td a {
|
|
||||||
padding: 24px !important;
|
|
||||||
}
|
|
||||||
*[class*="s-lg-"] > tbody > tr > td {
|
|
||||||
font-size: 0 !important;
|
|
||||||
line-height: 0 !important;
|
|
||||||
height: 0 !important;
|
|
||||||
}
|
|
||||||
.s-4 > tbody > tr > td {
|
|
||||||
font-size: 16px !important;
|
|
||||||
line-height: 16px !important;
|
|
||||||
height: 16px !important;
|
|
||||||
}
|
|
||||||
.s-6 > tbody > tr > td {
|
|
||||||
font-size: 24px !important;
|
|
||||||
line-height: 24px !important;
|
|
||||||
height: 24px !important;
|
|
||||||
}
|
|
||||||
.s-10 > tbody > tr > td {
|
|
||||||
font-size: 40px !important;
|
|
||||||
line-height: 40px !important;
|
|
||||||
height: 40px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body class="bg-light" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
class="bg-light"
|
<table class="bg-light body" valign="top" role="presentation" border="0" cellpadding="0" cellspacing="0" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="bg-light body"
|
|
||||||
valign="top"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td valign="top" style="line-height: 24px; font-size: 16px; margin: 0;" align="left" bgcolor="#f7fafc">
|
||||||
valign="top"
|
<table class="container" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||||
style="line-height: 24px; font-size: 16px; margin: 0"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="container"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td align="center" style="line-height: 24px; font-size: 16px; margin: 0; padding: 0 16px;">
|
||||||
align="center"
|
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 16px;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<!--[if (gte mso 9)|(IE)]>
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
<table align="center" role="presentation">
|
<table align="center" role="presentation">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="600">
|
<td width="600">
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<table
|
<table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px; margin: 0 auto;">
|
||||||
align="center"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%; max-width: 600px; margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
class="ax-center"
|
|
||||||
role="presentation"
|
|
||||||
align="center"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<img class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
alt="Revolt Logo"
|
|
||||||
class="w-24"
|
|
||||||
src="https://app.revolt.chat/assets/logo_round.png"
|
|
||||||
style="
|
|
||||||
height: auto;
|
|
||||||
line-height: 100%;
|
|
||||||
outline: none;
|
|
||||||
text-decoration: none;
|
|
||||||
display: block;
|
|
||||||
width: 96px;
|
|
||||||
border-style: none;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
width="96"
|
|
||||||
/>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="card p-6 p-lg-10 space-y-4" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; width: 100%; overflow: hidden; border: 1px solid #e2e8f0;" bgcolor="#ffffff">
|
||||||
class="card p-6 p-lg-10 space-y-4"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
border-radius: 6px;
|
|
||||||
border-collapse: separate !important;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; width: 100%; margin: 0; padding: 40px;" align="left" bgcolor="#ffffff">
|
||||||
style="
|
<h1 class="h3 fw-700" style="padding-top: 0; padding-bottom: 0; font-weight: 700 !important; vertical-align: baseline; font-size: 28px; line-height: 33.6px; margin: 0;" align="left">Password Reset</h1>
|
||||||
line-height: 24px;
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 40px;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<h1
|
|
||||||
class="h3 fw-700"
|
|
||||||
style="
|
|
||||||
padding-top: 0;
|
|
||||||
padding-bottom: 0;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
vertical-align: baseline;
|
|
||||||
font-size: 28px;
|
|
||||||
line-height: 33.6px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
Password Reset
|
|
||||||
</h1>
|
|
||||||
<table
|
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">You requested a password reset, click below to continue.</p>
|
||||||
class=""
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
You requested a password reset, click
|
|
||||||
below to continue.
|
|
||||||
</p>
|
|
||||||
<table
|
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="btn btn-primary p-3 fw-700" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; font-weight: 700 !important;">
|
||||||
class="btn btn-primary p-3 fw-700"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
border-radius: 6px;
|
|
||||||
border-collapse: separate !important;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; font-weight: 700 !important; margin: 0;" align="center" bgcolor="#0d6efd">
|
||||||
style="
|
<a href="{{url}}" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: block; font-weight: 700 !important; white-space: nowrap; background-color: #0d6efd; padding: 12px; border: 1px solid #0d6efd;">Reset</a>
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="center"
|
|
||||||
bgcolor="#0d6efd"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href="{{url}}"
|
|
||||||
style="
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: Helvetica, Arial,
|
|
||||||
sans-serif;
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 6px;
|
|
||||||
line-height: 20px;
|
|
||||||
display: block;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
white-space: nowrap;
|
|
||||||
background-color: #0d6efd;
|
|
||||||
padding: 12px;
|
|
||||||
border: 1px solid #0d6efd;
|
|
||||||
"
|
|
||||||
>Reset</a
|
|
||||||
>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -465,66 +93,58 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 24px;
|
|
||||||
width: 100%;
|
|
||||||
height: 24px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="24"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div
|
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||||
class="text-muted text-center"
|
This email is intended for {{email}}<br>
|
||||||
style="color: #718096"
|
Sent from Revolt<br>
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
This email is intended for {{email}}<br />
|
|
||||||
Sent from Revolt<br />
|
|
||||||
Made in Europe
|
Made in Europe
|
||||||
</div>
|
</div>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
 
|
||||||
line-height: 24px;
|
</td>
|
||||||
font-size: 24px;
|
</tr>
|
||||||
width: 100%;
|
</tbody>
|
||||||
height: 24px;
|
</table>
|
||||||
margin: 0;
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
"
|
<tbody>
|
||||||
align="left"
|
<tr>
|
||||||
width="100%"
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
height="24"
|
 
|
||||||
>
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<div class="text-muted text-xs" style="color: #718096; font-size: 12px; line-height: 14.4px;">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br>
|
||||||
|
Registered Company Number: 16260658<br>
|
||||||
|
Registered Office:<br>
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br>
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -21,6 +21,14 @@
|
|||||||
Sent from Revolt<br />
|
Sent from Revolt<br />
|
||||||
Made in Europe
|
Made in Europe
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-muted text-xs my-6 ax-center">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br />
|
||||||
|
Registered Company Number: 16260658<br />
|
||||||
|
Registered Office:<br />
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -5,3 +5,10 @@ Please navigate to: {{url}}
|
|||||||
This email is intended for {{email}}
|
This email is intended for {{email}}
|
||||||
Sent by Revolt
|
Sent by Revolt
|
||||||
Made in Europe
|
Made in Europe
|
||||||
|
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||||
|
|
||||||
|
Registration Number: 16260658
|
||||||
|
Registered Office:
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
You requested a password reset, if you did not perform this action you can safely ignore this email.
|
||||||
|
|
||||||
|
Please navigate to: {{url}}
|
||||||
|
|
||||||
|
This email is intended for {{email}}
|
||||||
|
|
||||||
|
This email has no association with Revolt or Revolt Platforms Ltd.
|
||||||
|
Learn more about third party instances here:
|
||||||
|
https://developers.revolt.chat/faq.html
|
||||||
@@ -1,408 +1,80 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<!-- Compiled with Bootstrap Email version: 1.5.1 -->
|
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
<meta name="x-apple-disable-message-reformatting">
|
||||||
<meta name="x-apple-disable-message-reformatting" />
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||||
<meta
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
name="format-detection"
|
|
||||||
content="telephone=no, date=no, address=no, email=no"
|
|
||||||
/>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body,
|
body,table,td{font-family:Helvetica,Arial,sans-serif !important}.ExternalClass{width:100%}.ExternalClass,.ExternalClass p,.ExternalClass span,.ExternalClass font,.ExternalClass td,.ExternalClass div{line-height:150%}a{text-decoration:none}*{color:inherit}a[x-apple-data-detectors],u+#body a,#MessageViewBody a{color:inherit;text-decoration:none;font-size:inherit;font-family:inherit;font-weight:inherit;line-height:inherit}img{-ms-interpolation-mode:bicubic}table:not([class^=s-]){font-family:Helvetica,Arial,sans-serif;mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;border-collapse:collapse}table:not([class^=s-]) td{border-spacing:0px;border-collapse:collapse}@media screen and (max-width: 600px){.w-full,.w-full>tbody>tr>td{width:100% !important}.w-24,.w-24>tbody>tr>td{width:96px !important}.p-lg-10:not(table),.p-lg-10:not(.btn)>tbody>tr>td,.p-lg-10.btn td a{padding:0 !important}.p-6:not(table),.p-6:not(.btn)>tbody>tr>td,.p-6.btn td a{padding:24px !important}*[class*=s-lg-]>tbody>tr>td{font-size:0 !important;line-height:0 !important;height:0 !important}.s-4>tbody>tr>td{font-size:16px !important;line-height:16px !important;height:16px !important}.s-6>tbody>tr>td{font-size:24px !important;line-height:24px !important;height:24px !important}.s-10>tbody>tr>td{font-size:40px !important;line-height:40px !important;height:40px !important}}
|
||||||
table,
|
|
||||||
td {
|
|
||||||
font-family: Helvetica, Arial, sans-serif !important;
|
|
||||||
}
|
|
||||||
.ExternalClass {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.ExternalClass,
|
|
||||||
.ExternalClass p,
|
|
||||||
.ExternalClass span,
|
|
||||||
.ExternalClass font,
|
|
||||||
.ExternalClass td,
|
|
||||||
.ExternalClass div {
|
|
||||||
line-height: 150%;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
a[x-apple-data-detectors],
|
|
||||||
u + #body a,
|
|
||||||
#MessageViewBody a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: inherit;
|
|
||||||
font-family: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
-ms-interpolation-mode: bicubic;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) {
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
mso-table-lspace: 0pt;
|
|
||||||
mso-table-rspace: 0pt;
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) td {
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
.w-full,
|
|
||||||
.w-full > tbody > tr > td {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
.w-24,
|
|
||||||
.w-24 > tbody > tr > td {
|
|
||||||
width: 96px !important;
|
|
||||||
}
|
|
||||||
.p-lg-10:not(table),
|
|
||||||
.p-lg-10:not(.btn) > tbody > tr > td,
|
|
||||||
.p-lg-10.btn td a {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
.p-6:not(table),
|
|
||||||
.p-6:not(.btn) > tbody > tr > td,
|
|
||||||
.p-6.btn td a {
|
|
||||||
padding: 24px !important;
|
|
||||||
}
|
|
||||||
*[class*="s-lg-"] > tbody > tr > td {
|
|
||||||
font-size: 0 !important;
|
|
||||||
line-height: 0 !important;
|
|
||||||
height: 0 !important;
|
|
||||||
}
|
|
||||||
.s-4 > tbody > tr > td {
|
|
||||||
font-size: 16px !important;
|
|
||||||
line-height: 16px !important;
|
|
||||||
height: 16px !important;
|
|
||||||
}
|
|
||||||
.s-6 > tbody > tr > td {
|
|
||||||
font-size: 24px !important;
|
|
||||||
line-height: 24px !important;
|
|
||||||
height: 24px !important;
|
|
||||||
}
|
|
||||||
.s-10 > tbody > tr > td {
|
|
||||||
font-size: 40px !important;
|
|
||||||
line-height: 40px !important;
|
|
||||||
height: 40px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body class="bg-light" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
class="bg-light"
|
<table class="bg-light body" valign="top" role="presentation" border="0" cellpadding="0" cellspacing="0" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="bg-light body"
|
|
||||||
valign="top"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td valign="top" style="line-height: 24px; font-size: 16px; margin: 0;" align="left" bgcolor="#f7fafc">
|
||||||
valign="top"
|
<table class="container" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||||
style="line-height: 24px; font-size: 16px; margin: 0"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="container"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td align="center" style="line-height: 24px; font-size: 16px; margin: 0; padding: 0 16px;">
|
||||||
align="center"
|
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 16px;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<!--[if (gte mso 9)|(IE)]>
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
<table align="center" role="presentation">
|
<table align="center" role="presentation">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="600">
|
<td width="600">
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<table
|
<table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px; margin: 0 auto;">
|
||||||
align="center"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%; max-width: 600px; margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
class="ax-center"
|
|
||||||
role="presentation"
|
|
||||||
align="center"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<img alt="Revolt Logo" class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
alt="Revolt Logo"
|
|
||||||
class="w-24"
|
|
||||||
src="https://app.revolt.chat/assets/logo_round.png"
|
|
||||||
style="
|
|
||||||
height: auto;
|
|
||||||
line-height: 100%;
|
|
||||||
outline: none;
|
|
||||||
text-decoration: none;
|
|
||||||
display: block;
|
|
||||||
width: 96px;
|
|
||||||
border-style: none;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
width="96"
|
|
||||||
/>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="card p-6 p-lg-10 space-y-4" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; width: 100%; overflow: hidden; border: 1px solid #e2e8f0;" bgcolor="#ffffff">
|
||||||
class="card p-6 p-lg-10 space-y-4"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
border-radius: 6px;
|
|
||||||
border-collapse: separate !important;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; width: 100%; margin: 0; padding: 40px;" align="left" bgcolor="#ffffff">
|
||||||
style="
|
<h1 class="h3 fw-700" style="padding-top: 0; padding-bottom: 0; font-weight: 700 !important; vertical-align: baseline; font-size: 28px; line-height: 33.6px; margin: 0;" align="left">Account Suspended</h1>
|
||||||
line-height: 24px;
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 40px;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<h1
|
|
||||||
class="h3 fw-700"
|
|
||||||
style="
|
|
||||||
padding-top: 0;
|
|
||||||
padding-bottom: 0;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
vertical-align: baseline;
|
|
||||||
font-size: 28px;
|
|
||||||
line-height: 33.6px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
Account Suspended
|
|
||||||
</h1>
|
|
||||||
<table
|
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">Your account has been suspended, for one or more reasons:</p>
|
||||||
class=""
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
Your account has been suspended, for one
|
|
||||||
or more reasons:
|
|
||||||
</p>
|
|
||||||
<table
|
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -411,193 +83,98 @@
|
|||||||
<ul class="">
|
<ul class="">
|
||||||
{{list}}
|
{{list}}
|
||||||
</ul>
|
</ul>
|
||||||
<table
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p
|
<p style="display: {{duration_display}}; line-height: 24px; font-size: 16px; width: 100%; margin: 0;" class="" align="left">
|
||||||
style="display: {{duration_display}}; line-height: 24px; font-size: 16px; width: 100%; margin: 0;"
|
You will be able to use your account again in {{duration}} days.
|
||||||
class=""
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
You will be able to use your account again
|
|
||||||
in {{duration}} days.
|
|
||||||
</p>
|
</p>
|
||||||
<table
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">
|
||||||
class=""
|
Further violations may result in a permanent ban depending on
|
||||||
style="
|
severity, please abide by the
|
||||||
line-height: 24px;
|
<a href="https://revolt.chat/aup" style="color: #0d6efd;">Acceptable Usage Policy</a>.
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
Further violations may result in a
|
|
||||||
permanent ban depending on severity,
|
|
||||||
please abide by the
|
|
||||||
<a
|
|
||||||
href="https://revolt.chat/aup"
|
|
||||||
style="color: #0d6efd"
|
|
||||||
>Acceptable Usage Policy</a
|
|
||||||
>.
|
|
||||||
</p>
|
</p>
|
||||||
<table
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p
|
<p style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">Ban evasion is prohibited and will be dealt with accordingly.</p>
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
Ban evasion is prohibited and will be
|
|
||||||
dealt with accordingly.
|
|
||||||
</p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 24px;
|
|
||||||
width: 100%;
|
|
||||||
height: 24px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="24"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div
|
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||||
class="text-muted text-center"
|
This email is intended for {{email}}<br>
|
||||||
style="color: #718096"
|
Sent from Revolt<br>
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
This email is intended for {{email}}<br />
|
|
||||||
Sent from Revolt<br />
|
|
||||||
Made in Europe
|
Made in Europe
|
||||||
</div>
|
</div>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
 
|
||||||
line-height: 24px;
|
</td>
|
||||||
font-size: 24px;
|
</tr>
|
||||||
width: 100%;
|
</tbody>
|
||||||
height: 24px;
|
</table>
|
||||||
margin: 0;
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
"
|
<tbody>
|
||||||
align="left"
|
<tr>
|
||||||
width="100%"
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
height="24"
|
 
|
||||||
>
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<div class="text-muted text-xs" style="color: #718096; font-size: 12px; line-height: 14.4px;">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br>
|
||||||
|
Registered Company Number: 16260658<br>
|
||||||
|
Registered Office:<br>
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br>
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -33,6 +33,14 @@
|
|||||||
Sent from Revolt<br />
|
Sent from Revolt<br />
|
||||||
Made in Europe
|
Made in Europe
|
||||||
</div>
|
</div>
|
||||||
|
<div class="text-muted text-xs my-6 ax-center">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br />
|
||||||
|
Registered Company Number: 16260658<br />
|
||||||
|
Registered Office:<br />
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -10,3 +10,10 @@ Ban evasion is prohibited and will be dealt with accordingly.
|
|||||||
This email is intended for {{email}}
|
This email is intended for {{email}}
|
||||||
Sent by Revolt
|
Sent by Revolt
|
||||||
Made in Europe
|
Made in Europe
|
||||||
|
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||||
|
|
||||||
|
Registration Number: 16260658
|
||||||
|
Registered Office:
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Your account has been suspended, for one or more reasons:
|
||||||
|
{{list}}
|
||||||
|
|
||||||
|
This email is intended for {{email}}
|
||||||
|
|
||||||
|
This email has no association with Revolt or Revolt Platforms Ltd.
|
||||||
|
Learn more about third party instances here:
|
||||||
|
https://developers.revolt.chat/faq.html
|
||||||
@@ -1,462 +1,90 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<!-- Compiled with Bootstrap Email version: 1.3.1 -->
|
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
<meta name="x-apple-disable-message-reformatting">
|
||||||
<meta name="x-apple-disable-message-reformatting" />
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||||
<meta
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
name="format-detection"
|
|
||||||
content="telephone=no, date=no, address=no, email=no"
|
|
||||||
/>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body,
|
body,table,td{font-family:Helvetica,Arial,sans-serif !important}.ExternalClass{width:100%}.ExternalClass,.ExternalClass p,.ExternalClass span,.ExternalClass font,.ExternalClass td,.ExternalClass div{line-height:150%}a{text-decoration:none}*{color:inherit}a[x-apple-data-detectors],u+#body a,#MessageViewBody a{color:inherit;text-decoration:none;font-size:inherit;font-family:inherit;font-weight:inherit;line-height:inherit}img{-ms-interpolation-mode:bicubic}table:not([class^=s-]){font-family:Helvetica,Arial,sans-serif;mso-table-lspace:0pt;mso-table-rspace:0pt;border-spacing:0px;border-collapse:collapse}table:not([class^=s-]) td{border-spacing:0px;border-collapse:collapse}@media screen and (max-width: 600px){.w-full,.w-full>tbody>tr>td{width:100% !important}.w-24,.w-24>tbody>tr>td{width:96px !important}.p-lg-10:not(table),.p-lg-10:not(.btn)>tbody>tr>td,.p-lg-10.btn td a{padding:0 !important}.p-3:not(table),.p-3:not(.btn)>tbody>tr>td,.p-3.btn td a{padding:12px !important}.p-6:not(table),.p-6:not(.btn)>tbody>tr>td,.p-6.btn td a{padding:24px !important}*[class*=s-lg-]>tbody>tr>td{font-size:0 !important;line-height:0 !important;height:0 !important}.s-4>tbody>tr>td{font-size:16px !important;line-height:16px !important;height:16px !important}.s-6>tbody>tr>td{font-size:24px !important;line-height:24px !important;height:24px !important}.s-10>tbody>tr>td{font-size:40px !important;line-height:40px !important;height:40px !important}}
|
||||||
table,
|
|
||||||
td {
|
|
||||||
font-family: Helvetica, Arial, sans-serif !important;
|
|
||||||
}
|
|
||||||
.ExternalClass {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.ExternalClass,
|
|
||||||
.ExternalClass p,
|
|
||||||
.ExternalClass span,
|
|
||||||
.ExternalClass font,
|
|
||||||
.ExternalClass td,
|
|
||||||
.ExternalClass div {
|
|
||||||
line-height: 150%;
|
|
||||||
}
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
* {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
a[x-apple-data-detectors],
|
|
||||||
u + #body a,
|
|
||||||
#MessageViewBody a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: inherit;
|
|
||||||
font-family: inherit;
|
|
||||||
font-weight: inherit;
|
|
||||||
line-height: inherit;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
-ms-interpolation-mode: bicubic;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) {
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
mso-table-lspace: 0pt;
|
|
||||||
mso-table-rspace: 0pt;
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
table:not([class^="s-"]) td {
|
|
||||||
border-spacing: 0px;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 600px) {
|
|
||||||
.w-full,
|
|
||||||
.w-full > tbody > tr > td {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
.w-24,
|
|
||||||
.w-24 > tbody > tr > td {
|
|
||||||
width: 96px !important;
|
|
||||||
}
|
|
||||||
.p-lg-10:not(table),
|
|
||||||
.p-lg-10:not(.btn) > tbody > tr > td,
|
|
||||||
.p-lg-10.btn td a {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
.p-3:not(table),
|
|
||||||
.p-3:not(.btn) > tbody > tr > td,
|
|
||||||
.p-3.btn td a {
|
|
||||||
padding: 12px !important;
|
|
||||||
}
|
|
||||||
.p-6:not(table),
|
|
||||||
.p-6:not(.btn) > tbody > tr > td,
|
|
||||||
.p-6.btn td a {
|
|
||||||
padding: 24px !important;
|
|
||||||
}
|
|
||||||
*[class*="s-lg-"] > tbody > tr > td {
|
|
||||||
font-size: 0 !important;
|
|
||||||
line-height: 0 !important;
|
|
||||||
height: 0 !important;
|
|
||||||
}
|
|
||||||
.s-4 > tbody > tr > td {
|
|
||||||
font-size: 16px !important;
|
|
||||||
line-height: 16px !important;
|
|
||||||
height: 16px !important;
|
|
||||||
}
|
|
||||||
.s-6 > tbody > tr > td {
|
|
||||||
font-size: 24px !important;
|
|
||||||
line-height: 24px !important;
|
|
||||||
height: 24px !important;
|
|
||||||
}
|
|
||||||
.s-10 > tbody > tr > td {
|
|
||||||
font-size: 40px !important;
|
|
||||||
line-height: 40px !important;
|
|
||||||
height: 40px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body class="bg-light" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
class="bg-light"
|
<table class="bg-light body" valign="top" role="presentation" border="0" cellpadding="0" cellspacing="0" style="outline: 0; width: 100%; min-width: 100%; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; font-family: Helvetica, Arial, sans-serif; line-height: 24px; font-weight: normal; font-size: 16px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; color: #000000; margin: 0; padding: 0; border-width: 0;" bgcolor="#f7fafc">
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="bg-light body"
|
|
||||||
valign="top"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
outline: 0;
|
|
||||||
width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
-webkit-text-size-adjust: 100%;
|
|
||||||
-ms-text-size-adjust: 100%;
|
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 16px;
|
|
||||||
-moz-box-sizing: border-box;
|
|
||||||
-webkit-box-sizing: border-box;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td valign="top" style="line-height: 24px; font-size: 16px; margin: 0;" align="left" bgcolor="#f7fafc">
|
||||||
valign="top"
|
<table class="container" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
|
||||||
style="line-height: 24px; font-size: 16px; margin: 0"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#f7fafc"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="container"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td align="center" style="line-height: 24px; font-size: 16px; margin: 0; padding: 0 16px;">
|
||||||
align="center"
|
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0 16px;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<!--[if (gte mso 9)|(IE)]>
|
<!--[if (gte mso 9)|(IE)]>
|
||||||
<table align="center" role="presentation">
|
<table align="center" role="presentation">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="600">
|
<td width="600">
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<table
|
<table align="center" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px; margin: 0 auto;">
|
||||||
align="center"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%; max-width: 600px; margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
class="ax-center"
|
|
||||||
role="presentation"
|
|
||||||
align="center"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="margin: 0 auto"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
style="
|
<img alt="Revolt Logo" class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
alt="Revolt Logo"
|
|
||||||
class="w-24"
|
|
||||||
src="https://app.revolt.chat/assets/logo_round.png"
|
|
||||||
style="
|
|
||||||
height: auto;
|
|
||||||
line-height: 100%;
|
|
||||||
outline: none;
|
|
||||||
text-decoration: none;
|
|
||||||
display: block;
|
|
||||||
width: 96px;
|
|
||||||
border-style: none;
|
|
||||||
border-width: 0;
|
|
||||||
"
|
|
||||||
width="96"
|
|
||||||
/>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-10 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-10 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 40px; font-size: 40px; width: 100%; height: 40px; margin: 0;" align="left" width="100%" height="40">
|
||||||
style="
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 40px;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="40"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="card p-6 p-lg-10 space-y-4" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; width: 100%; overflow: hidden; border: 1px solid #e2e8f0;" bgcolor="#ffffff">
|
||||||
class="card p-6 p-lg-10 space-y-4"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
border-radius: 6px;
|
|
||||||
border-collapse: separate !important;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; width: 100%; margin: 0; padding: 40px;" align="left" bgcolor="#ffffff">
|
||||||
style="
|
<h1 class="h3 fw-700" style="padding-top: 0; padding-bottom: 0; font-weight: 700 !important; vertical-align: baseline; font-size: 28px; line-height: 33.6px; margin: 0;" align="left">Almost there!</h1>
|
||||||
line-height: 24px;
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 40px;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
bgcolor="#ffffff"
|
|
||||||
>
|
|
||||||
<h1
|
|
||||||
class="h3 fw-700"
|
|
||||||
style="
|
|
||||||
padding-top: 0;
|
|
||||||
padding-bottom: 0;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
vertical-align: baseline;
|
|
||||||
font-size: 28px;
|
|
||||||
line-height: 33.6px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
Almost there!
|
|
||||||
</h1>
|
|
||||||
<table
|
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p
|
<p class="" style="line-height: 24px; font-size: 16px; width: 100%; margin: 0;" align="left">To complete your sign up, we just need to verify your email.</p>
|
||||||
class=""
|
<table class="s-4 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
>
|
|
||||||
To complete your sign up, we just need to
|
|
||||||
verify your email.
|
|
||||||
</p>
|
|
||||||
<table
|
|
||||||
class="s-4 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 16px; font-size: 16px; width: 100%; height: 16px; margin: 0;" align="left" width="100%" height="16">
|
||||||
style="
|
|
||||||
line-height: 16px;
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
height: 16px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="16"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="btn btn-primary p-3 fw-700" role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-radius: 6px; border-collapse: separate !important; font-weight: 700 !important;">
|
||||||
class="btn btn-primary p-3 fw-700"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="
|
|
||||||
border-radius: 6px;
|
|
||||||
border-collapse: separate !important;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 16px; border-radius: 6px; font-weight: 700 !important; margin: 0;" align="center" bgcolor="#0d6efd">
|
||||||
style="
|
<a href="{{url}}" style="color: #ffffff; font-size: 16px; font-family: Helvetica, Arial, sans-serif; text-decoration: none; border-radius: 6px; line-height: 20px; display: block; font-weight: 700 !important; white-space: nowrap; background-color: #0d6efd; padding: 12px; border: 1px solid #0d6efd;">Confirm</a>
|
||||||
line-height: 24px;
|
|
||||||
font-size: 16px;
|
|
||||||
border-radius: 6px;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="center"
|
|
||||||
bgcolor="#0d6efd"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href="{{url}}"
|
|
||||||
style="
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: Helvetica, Arial,
|
|
||||||
sans-serif;
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 6px;
|
|
||||||
line-height: 20px;
|
|
||||||
display: block;
|
|
||||||
font-weight: 700 !important;
|
|
||||||
white-space: nowrap;
|
|
||||||
background-color: #0d6efd;
|
|
||||||
padding: 12px;
|
|
||||||
border: 1px solid #0d6efd;
|
|
||||||
"
|
|
||||||
>Confirm</a
|
|
||||||
>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -465,66 +93,58 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
|
||||||
line-height: 24px;
|
|
||||||
font-size: 24px;
|
|
||||||
width: 100%;
|
|
||||||
height: 24px;
|
|
||||||
margin: 0;
|
|
||||||
"
|
|
||||||
align="left"
|
|
||||||
width="100%"
|
|
||||||
height="24"
|
|
||||||
>
|
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div
|
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||||
class="text-muted text-center"
|
This email is intended for {{email}}<br>
|
||||||
style="color: #718096"
|
Sent from Revolt<br>
|
||||||
align="center"
|
|
||||||
>
|
|
||||||
This email is intended for {{email}}<br />
|
|
||||||
Sent from Revolt<br />
|
|
||||||
Made in Europe
|
Made in Europe
|
||||||
</div>
|
</div>
|
||||||
<table
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
class="s-6 w-full"
|
|
||||||
role="presentation"
|
|
||||||
border="0"
|
|
||||||
cellpadding="0"
|
|
||||||
cellspacing="0"
|
|
||||||
style="width: 100%"
|
|
||||||
width="100%"
|
|
||||||
>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
style="
|
 
|
||||||
line-height: 24px;
|
</td>
|
||||||
font-size: 24px;
|
</tr>
|
||||||
width: 100%;
|
</tbody>
|
||||||
height: 24px;
|
</table>
|
||||||
margin: 0;
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
"
|
<tbody>
|
||||||
align="left"
|
<tr>
|
||||||
width="100%"
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
height="24"
|
 
|
||||||
>
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="ax-center" role="presentation" align="center" border="0" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||||
|
<div class="text-muted text-xs" style="color: #718096; font-size: 12px; line-height: 14.4px;">
|
||||||
|
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||||
|
laws of England and Wales.<br>
|
||||||
|
Registered Company Number: 16260658<br>
|
||||||
|
Registered Office:<br>
|
||||||
|
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br>
|
||||||
|
Holborn, United Kingdom, EC1N 8DX
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="line-height: 24px; font-size: 24px; width: 100%; height: 24px; margin: 0;" align="left" width="100%" height="24">
|
||||||
 
|
 
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user