Could be the first version 6-rc

This commit is contained in:
adator
2024-11-06 01:15:11 +01:00
parent e07b047b6a
commit 709e8d4419
12 changed files with 215 additions and 113 deletions

View File

@@ -108,6 +108,27 @@ class Channel:
except ValueError as ve:
self.Logs.error(f'{ve}')
def add_user_to_a_channel(self, channel_name: str, uid: str) -> bool:
try:
result = False
chanObj = self.get_Channel(channel_name)
self.Logs.debug(f"** {__name__}")
if chanObj is None:
result = self.insert(MChannel(channel_name, uids=[uid]))
# self.Logs.debug(f"** {__name__} - result: {result}")
# self.Logs.debug(f'New Channel Created: ({chanObj})')
return result
chanObj.uids.append(uid)
del_duplicates = list(set(chanObj.uids))
chanObj.uids = del_duplicates
# self.Logs.debug(f'New Channel Created: ({chanObj})')
return True
except Exception as err:
self.Logs.error(f'{err}')
def clean_channel(self) -> None:
"""Remove Channels if empty
"""