Not case sensitive

main
Bob Mottram 2022-12-30 21:17:03 +00:00
parent 863bf90e25
commit f22647fa3a
1 changed files with 3 additions and 14 deletions

View File

@ -100,7 +100,7 @@ def _receive_calendar_events(base_dir: str, nickname: str, domain: str,
handle = following_nickname + '@' + following_domain
# check that you are following this handle
if not _text_in_file2(handle + '\n', following_filename):
if not _text_in_file2(handle + '\n', following_filename, False):
print('WARN: ' + handle + ' is not in ' + following_filename)
return
@ -137,25 +137,14 @@ def _receive_calendar_events(base_dir: str, nickname: str, domain: str,
print('EX: unable to write ' + calendar_filename)
# already in the calendar file?
if handle + '\n' in following_handles:
if handle + '\n' in following_handles or \
handle + '\n' in following_handles.lower():
print(handle + ' exists in followingCalendar.txt')
if add:
# already added
return
# remove from calendar file
following_handles = following_handles.replace(handle + '\n', '')
try:
with open(calendar_filename, 'w+',
encoding='utf-8') as fp_cal:
fp_cal.write(following_handles)
except OSError:
print('EX: _receive_calendar_events 3 ' + calendar_filename)
elif handle + '\n' in following_handles.lower():
print(handle + ' exists in followingCalendar.txt')
if add:
# already added
return
# remove from calendar file
following_handles = \
following_handles.replace(handle.lower() + '\n', '')
try: