Compare commits
5 Commits
2772ee7188
...
86bc48f3e0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
86bc48f3e0 | ||
![]() |
bb81f0e559 | ||
![]() |
fc79551656 | ||
![]() |
b6a8737d2e | ||
![]() |
c5e00a2c73 |
1
.github/workflows/test-docs.yml
vendored
1
.github/workflows/test-docs.yml
vendored
@ -5,6 +5,7 @@ on: [push, pull_request]
|
|||||||
jobs:
|
jobs:
|
||||||
test_docs:
|
test_docs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.10"]
|
python-version: ["3.10"]
|
||||||
|
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@ -12,6 +12,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
name: test py${{ matrix.python-version }} with ${{ matrix.db_name }}
|
name: test py${{ matrix.python-version }} with ${{ matrix.db_name }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 8
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.10", "3.11"]
|
python-version: ["3.10", "3.11"]
|
||||||
|
@ -12,6 +12,7 @@ from django.utils.safestring import mark_safe
|
|||||||
|
|
||||||
from core.files import get_remote_file
|
from core.files import get_remote_file
|
||||||
from core.html import strip_html
|
from core.html import strip_html
|
||||||
|
from core.ld import format_ld_date
|
||||||
from core.models import Config
|
from core.models import Config
|
||||||
from core.uploads import upload_emoji_namer
|
from core.uploads import upload_emoji_namer
|
||||||
from core.uris import AutoAbsoluteUrl, RelativeAbsoluteUrl, StaticAbsoluteUrl
|
from core.uris import AutoAbsoluteUrl, RelativeAbsoluteUrl, StaticAbsoluteUrl
|
||||||
@ -218,13 +219,14 @@ class Emoji(StatorModel):
|
|||||||
"""
|
"""
|
||||||
return {
|
return {
|
||||||
"id": self.object_uri or f"https://{settings.MAIN_DOMAIN}/emoji/{self.pk}/",
|
"id": self.object_uri or f"https://{settings.MAIN_DOMAIN}/emoji/{self.pk}/",
|
||||||
"type": "toot:Emoji",
|
"type": "Emoji",
|
||||||
"name": self.shortcode,
|
"name": f":{self.shortcode}:",
|
||||||
"icon": {
|
"icon": {
|
||||||
"type": "Image",
|
"type": "Image",
|
||||||
"mediaType": self.mimetype,
|
"mediaType": self.mimetype,
|
||||||
"url": self.full_url().absolute,
|
"url": self.full_url().absolute,
|
||||||
},
|
},
|
||||||
|
"updated": format_ld_date(self.updated),
|
||||||
}
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -180,7 +180,7 @@ class Post(StatorModel):
|
|||||||
local = models.BooleanField()
|
local = models.BooleanField()
|
||||||
|
|
||||||
# The canonical object ID
|
# The canonical object ID
|
||||||
object_uri = models.CharField(max_length=500, blank=True, null=True, unique=True)
|
object_uri = models.CharField(max_length=2048, blank=True, null=True, unique=True)
|
||||||
|
|
||||||
# Who should be able to see this Post
|
# Who should be able to see this Post
|
||||||
visibility = models.IntegerField(
|
visibility = models.IntegerField(
|
||||||
@ -197,7 +197,7 @@ class Post(StatorModel):
|
|||||||
summary = models.TextField(blank=True, null=True)
|
summary = models.TextField(blank=True, null=True)
|
||||||
|
|
||||||
# The public, web URL of this Post on the original server
|
# The public, web URL of this Post on the original server
|
||||||
url = models.CharField(max_length=500, blank=True, null=True)
|
url = models.CharField(max_length=2048, blank=True, null=True)
|
||||||
|
|
||||||
# The Post it is replying to as an AP ID URI
|
# The Post it is replying to as an AP ID URI
|
||||||
# (as otherwise we'd have to pull entire threads to use IDs)
|
# (as otherwise we'd have to pull entire threads to use IDs)
|
||||||
|
@ -96,7 +96,7 @@ class PostAttachment(StatorModel):
|
|||||||
"width": self.width,
|
"width": self.width,
|
||||||
"height": self.height,
|
"height": self.height,
|
||||||
"mediaType": self.mimetype,
|
"mediaType": self.mimetype,
|
||||||
"toot:focalPoint": [0, 0],
|
"blurhash": self.blurhash,
|
||||||
}
|
}
|
||||||
|
|
||||||
### Mastodon Client API ###
|
### Mastodon Client API ###
|
||||||
|
@ -410,12 +410,15 @@ def canonicalise(json_data: dict, include_security: bool = False) -> dict:
|
|||||||
context = [
|
context = [
|
||||||
"https://www.w3.org/ns/activitystreams",
|
"https://www.w3.org/ns/activitystreams",
|
||||||
{
|
{
|
||||||
|
"blurhash": "toot:blurhash",
|
||||||
|
"Emoji": "toot:Emoji",
|
||||||
|
"focalPoint": {"@container": "@list", "@id": "toot:focalPoint"},
|
||||||
|
"Hashtag": "as:Hashtag",
|
||||||
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
||||||
|
"Public": "as:Public",
|
||||||
"sensitive": "as:sensitive",
|
"sensitive": "as:sensitive",
|
||||||
"toot": "http://joinmastodon.org/ns#",
|
"toot": "http://joinmastodon.org/ns#",
|
||||||
"votersCount": "toot:votersCount",
|
"votersCount": "toot:votersCount",
|
||||||
"Hashtag": "as:Hashtag",
|
|
||||||
"Public": "as:Public",
|
|
||||||
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
if include_security:
|
if include_security:
|
||||||
|
@ -217,7 +217,7 @@ class Identity(StatorModel):
|
|||||||
return []
|
return []
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"name": data["name"],
|
"name": imageify_emojis(strip_html(data["name"]), self.domain),
|
||||||
"value": imageify_emojis(strip_html(data["value"]), self.domain),
|
"value": imageify_emojis(strip_html(data["value"]), self.domain),
|
||||||
}
|
}
|
||||||
for data in self.metadata
|
for data in self.metadata
|
||||||
|
@ -65,7 +65,7 @@ class DomainCreate(FormView):
|
|||||||
)
|
)
|
||||||
default = forms.BooleanField(
|
default = forms.BooleanField(
|
||||||
help_text="If this is the default option for new identities",
|
help_text="If this is the default option for new identities",
|
||||||
widget=forms.Select(choices=[(True, "Yes"), (False, "No")]),
|
widget=forms.Select(choices=[(False, "No"), (True, "Yes")]),
|
||||||
required=False,
|
required=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user