mirror of https://gitlab.com/bashrc2/epicyon
Abbreviate function name
parent
9ddad5366b
commit
292fa6fd8f
8
posts.py
8
posts.py
|
@ -31,7 +31,7 @@ from session import postImage
|
||||||
from webfinger import webfingerHandle
|
from webfinger import webfingerHandle
|
||||||
from httpsig import createSignedHeader
|
from httpsig import createSignedHeader
|
||||||
from siteactive import siteIsActive
|
from siteactive import siteIsActive
|
||||||
from utils import removeInvalidCharacters
|
from utils import removeInvalidChars
|
||||||
from utils import fileLastModified
|
from utils import fileLastModified
|
||||||
from utils import isPublicPost
|
from utils import isPublicPost
|
||||||
from utils import hasUsersPath
|
from utils import hasUsersPath
|
||||||
|
@ -824,7 +824,7 @@ def validContentWarning(cw: str) -> str:
|
||||||
# so remove them
|
# so remove them
|
||||||
if '#' in cw:
|
if '#' in cw:
|
||||||
cw = cw.replace('#', '').replace(' ', ' ')
|
cw = cw.replace('#', '').replace(' ', ' ')
|
||||||
return removeInvalidCharacters(cw)
|
return removeInvalidChars(cw)
|
||||||
|
|
||||||
|
|
||||||
def _loadAutoCW(baseDir: str, nickname: str, domain: str) -> []:
|
def _loadAutoCW(baseDir: str, nickname: str, domain: str) -> []:
|
||||||
|
@ -881,7 +881,7 @@ def _createPostBase(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
eventStatus=None, ticketUrl=None) -> {}:
|
eventStatus=None, ticketUrl=None) -> {}:
|
||||||
"""Creates a message
|
"""Creates a message
|
||||||
"""
|
"""
|
||||||
content = removeInvalidCharacters(content)
|
content = removeInvalidChars(content)
|
||||||
|
|
||||||
subject = _addAutoCW(baseDir, nickname, domain, subject, content)
|
subject = _addAutoCW(baseDir, nickname, domain, subject, content)
|
||||||
|
|
||||||
|
@ -927,7 +927,7 @@ def _createPostBase(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
sensitive = False
|
sensitive = False
|
||||||
summary = None
|
summary = None
|
||||||
if subject:
|
if subject:
|
||||||
summary = removeInvalidCharacters(validContentWarning(subject))
|
summary = removeInvalidChars(validContentWarning(subject))
|
||||||
sensitive = True
|
sensitive = True
|
||||||
|
|
||||||
toRecipients = []
|
toRecipients = []
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -528,7 +528,7 @@ def containsInvalidChars(jsonStr: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def removeInvalidCharacters(text: str) -> str:
|
def removeInvalidChars(text: str) -> str:
|
||||||
"""Removes any invalid characters from a string
|
"""Removes any invalid characters from a string
|
||||||
"""
|
"""
|
||||||
for isInvalid in invalidCharacters:
|
for isInvalid in invalidCharacters:
|
||||||
|
|
Loading…
Reference in New Issue