diff --git a/announce.py b/announce.py index 9601d5cb..708b7adb 100644 --- a/announce.py +++ b/announce.py @@ -67,8 +67,8 @@ def announcePublic(baseDir: str,federationList: [],username: str, domain: str, p ccUrl = prefix + '://'+fromDomain+'/users/'+username+'/followers' return createAnnounce(baseDir,username, domain, port,toUrl, ccUrl, https, objectUrl, saveToFile) -def repeatMessage(baseDir: str,federationList: [],username: str, domain: str, port: int, https: bool, announceUsername: str, announceDomain: str, announcePort: int, announceStatusNumber: int, announceHttps: bool, saveToFile: bool) -> {}: - """Repeats a given status message +def repeatPost(baseDir: str,federationList: [],username: str, domain: str, port: int, https: bool, announceUsername: str, announceDomain: str, announcePort: int, announceStatusNumber: int, announceHttps: bool, saveToFile: bool) -> {}: + """Repeats a given status post """ prefix='https' if not announceHttps: diff --git a/like.py b/like.py index a63c5af3..625acb84 100644 --- a/like.py +++ b/like.py @@ -10,7 +10,7 @@ import json import commentjson from utils import urlPermitted -def like(baseDir: str,federationList: [],username: str, domain: str, port: int,toUrl: str, ccUrl: str, https: bool,objectUrl: str, saveToFile: bool) -> {}: +def like(baseDir: str,federationList: [],username: str,domain: str,port: int,toUrl: str,ccUrl: str,https: bool,objectUrl: str,saveToFile: bool) -> {}: """Creates a like Typically toUrl will be a followers collection and ccUrl might be a specific person whose post was liked @@ -42,3 +42,18 @@ def like(baseDir: str,federationList: [],username: str, domain: str, port: int,t domain=domain.split(':')[0] # TODO update likes collection return newLike + +def likePost(baseDir: str,federationList: [],username: str, domain: str, port: int, https: bool, likeUsername: str, likeDomain: str, likePort: int, likeStatusNumber: int, likeHttps: bool,saveToFile: bool) -> {}: + """Likes a given status post + """ + prefix='https' + if not likeHttps: + prefix='http' + + likeDomain=likeDomain + if likePort!=80 and likePort!=443: + likeDomain=likeDomain+':'+str(likePort) + + objectUrl = prefix + '://'+likeDomain+'/users/'+likeUsername+'/statuses/'+str(likeStatusNumber) + + return like(baseDir,federationList,username,domain,port,toUrl,ccUrl,https,objectUrl,saveToFile)