# Path: reddit/redditconstants.py
# MAXPOSTS = 100
# 
# WAIT = 10
# 
# Path: reddit/redditconstants.py
# PRIVILEDGEDAUTHORS = ['ReaverXai', 'm4rx', 'klopjobacid', 'Decency', '0Hellspawn0', 'wykrhm', 'crimson589',
#                       'Intolerable', 'lestye', 'intolerable-bot', 'D2TournamentThreads', 'AutoModerator',
#                       'coronaria', 'leafeator', 'lumbdi']


import time
from reddit.redditconstants import MAXPOSTS, WAIT
from reddit.redditconstants import PRIVILEDGEDAUTHORS
#message = True


def deleteRequestedComments(r):
    while True:
        try:
            print('[workerdeleterequestedcomments] checking mail with DELETION subject')
            unread = r.inbox.unread()
            for msg in unread:
                print('You have Mail!')
                try:
                    if (msg.subject == 'deletion'):
                        print('subject deletion')
                        genComment = r.info([msg.body])
                        comment = next(genComment)
                        print('forming comment success')
                        commentParent = comment.parent()
                        print('getting parent success')


# Path: reddit/redditconstants.py
# MAXPOSTS = 100
# 
# WAIT = 10
# 
# Path: reddit/redditconstants.py
# PRIVILEDGEDAUTHORS = ['ReaverXai', 'm4rx', 'klopjobacid', 'Decency', '0Hellspawn0', 'wykrhm', 'crimson589',
#                       'Intolerable', 'lestye', 'intolerable-bot', 'D2TournamentThreads', 'AutoModerator',
#                       'coronaria', 'leafeator', 'lumbdi']


# Path: reddit/workerdeleterequestedcomments.py
import time
from reddit.redditconstants import MAXPOSTS, WAIT
from reddit.redditconstants import PRIVILEDGEDAUTHORS

#message = True


def deleteRequestedComments(r):
    while True:
        try:
            print('[workerdeleterequestedcomments] checking mail with DELETION subject')
            unread = r.inbox.unread()
            for msg in unread:
                print('You have Mail!')
                try:
                    if (msg.subject == 'deletion'):
                        print('subject deletion')
                        genComment = r.info([msg.body])
                        comment = next(genComment)
                        print('forming comment success')
                        commentParent = comment.parent()
                        print('getting parent success')


                        if (msg.author.name in PRIVILEDGEDAUTHORS or msg.author.name == commentParent.author.name):