mirror of https://gitlab.com/bashrc2/epicyon
Commit ActivityPub type
parent
7c6b2fd05f
commit
08f19f2e8d
4
git.py
4
git.py
|
@ -41,9 +41,13 @@ def getGitProjectName(baseDir: str, nickname: str, domain: str,
|
|||
|
||||
|
||||
def isGitPatch(baseDir: str, nickname: str, domain: str,
|
||||
messageType: str,
|
||||
subject: str, content: str) -> bool:
|
||||
"""Is the given post content a git patch?
|
||||
"""
|
||||
if messageType != 'Note' and \
|
||||
messageType != 'Commit':
|
||||
return False
|
||||
# must have a subject line
|
||||
if not subject:
|
||||
return False
|
||||
|
|
1
inbox.py
1
inbox.py
|
@ -1581,6 +1581,7 @@ def validPostContent(baseDir: str, nickname: str, domain: str,
|
|||
if 'Z' not in messageJson['object']['published']:
|
||||
return False
|
||||
if isGitPatch(baseDir, nickname, domain,
|
||||
messageJson['object']['type'],
|
||||
messageJson['object']['summary'],
|
||||
messageJson['object']['content']):
|
||||
return True
|
||||
|
|
|
@ -188,6 +188,7 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
|
|||
messageJson['type'] == 'Question' or \
|
||||
messageJson['type'] == 'Note' or \
|
||||
messageJson['type'] == 'Article' or \
|
||||
messageJson['type'] == 'Commit' or \
|
||||
messageJson['type'] == 'Announce':
|
||||
indexes = [outboxName, "inbox"]
|
||||
for boxNameIndex in indexes:
|
||||
|
|
2
posts.py
2
posts.py
|
@ -2251,6 +2251,7 @@ def isDM(postJsonObject: {}) -> bool:
|
|||
if not isinstance(postJsonObject['object'], dict):
|
||||
return False
|
||||
if postJsonObject['object']['type'] != 'Note' and \
|
||||
postJsonObject['object']['type'] != 'Commit' and \
|
||||
postJsonObject['object']['type'] != 'Article':
|
||||
return False
|
||||
if postJsonObject['object'].get('moderationStatus'):
|
||||
|
@ -2427,6 +2428,7 @@ def addPostStringToTimeline(postStr: str, boxname: str,
|
|||
# must be a "Note" or "Announce" type
|
||||
if ('"Note"' in postStr or
|
||||
'"Article"' in postStr or
|
||||
'"Commit"' in postStr or
|
||||
'"Announce"' in postStr or
|
||||
('"Question"' in postStr and
|
||||
('"Create"' in postStr or '"Update"' in postStr))):
|
||||
|
|
Loading…
Reference in New Issue