Boolean notification values

merge-requests/30/head
Bob Mottram 2021-03-09 22:25:32 +00:00
parent 4414666587
commit fc1b22fbd9
1 changed files with 8 additions and 8 deletions

View File

@ -12,8 +12,6 @@ import random
import urllib.parse import urllib.parse
from auth import createBasicAuthHeader from auth import createBasicAuthHeader
from session import getJson from session import getJson
from utils import isDM
from utils import isReply
from utils import camelCaseSplit from utils import camelCaseSplit
from utils import getDomainFromActor from utils import getDomainFromActor
from utils import getNicknameFromActor from utils import getNicknameFromActor
@ -449,10 +447,6 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str,
if postJsonObject['object'].get('id'): if postJsonObject['object'].get('id'):
postId = postJsonObject['object']['id'] postId = postJsonObject['object']['id']
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
postDM = isDM(postJsonObject)
postReply = isReply(postJsonObject, actor)
followRequestsExist = False followRequestsExist = False
accountsDir = baseDir + '/accounts/' + nickname + '@' + domainFull accountsDir = baseDir + '/accounts/' + nickname + '@' + domainFull
approveFollowsFilename = accountsDir + '/followrequests.txt' approveFollowsFilename = accountsDir + '/followrequests.txt'
@ -461,13 +455,19 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str,
follows = fp.readlines() follows = fp.readlines()
if len(follows) > 0: if len(follows) > 0:
followRequestsExist = True followRequestsExist = True
postDM = False
dmFilename = accountsDir + '/.newDM'
if os.path.isfile(dmFilename):
postDM = True
postReply = False
replyFilename = accountsDir + '/.newReply'
if os.path.isfile(replyFilename):
postReply = True
likedBy = '' likedBy = ''
likeFilename = accountsDir + '/.newLike' likeFilename = accountsDir + '/.newLike'
if os.path.isfile(likeFilename): if os.path.isfile(likeFilename):
with open(likeFilename, 'r') as fp: with open(likeFilename, 'r') as fp:
likedBy = fp.read() likedBy = fp.read()
if '##sent##' in likedBy:
likedBy = ''
calendarFilename = accountsDir + '/.newCalendar' calendarFilename = accountsDir + '/.newCalendar'
postCal = os.path.isfile(calendarFilename) postCal = os.path.isfile(calendarFilename)
shareFilename = accountsDir + '/.newShare' shareFilename = accountsDir + '/.newShare'