Skip to content

Commit

Permalink
Update version and merge duplicate contacts
Browse files Browse the repository at this point in the history
Updated the project version to 0.5.10.6 in setup.cfg, pyproject.toml, and `__init__.py`. Added functionality to remove duplicate contacts in `signal_contacts.py` and re-enabled a code block in `signal_contact.py` for better contact comparison.
  • Loading branch information
pnearing committed Sep 14, 2024
1 parent 55fe037 commit 01439fe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "SignalCliAPi"
version = "0.5.10.5"
version = "0.5.10.6"
authors = [
{ name="Peter Nearing", email="[email protected]" }
]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = SignalCliApi
version = 0.5.10.5
version = 0.5.10.6
author = Peter Nearing
author_email = [email protected]
description = A python interface to the signal-cli found at https://github.com/AsamK/signal-cli
Expand Down
2 changes: 1 addition & 1 deletion src/signal_cli_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
File: __init__.py
Description: A python3 interface to signal-cli.
"""
__version__: str = '0.5.10.5'
__version__: str = '0.5.10.6'
__author__: str = 'Peter Nearing'
__email__: str = '[email protected]'

Expand Down
6 changes: 3 additions & 3 deletions src/signal_cli_api/signal_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ def __eq__(self, other: Self) -> bool:
if self.uuid == other.uuid or self.number == other.number:
self.__update__(other)
return True
# if super().__eq__(other):
# self.__update__(other)
# return True
if super().__eq__(other):
self.__update__(other)
return True
return False

def __str__(self) -> str:
Expand Down
11 changes: 11 additions & 0 deletions src/signal_cli_api/signal_contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,20 @@ def __init__(self,
else:
logger.debug("self-contact found, ensuring name is '%s'", SELF_CONTACT_NAME)
self_contact.set_name(SELF_CONTACT_NAME)
# Merge duplicate contacts:
self.__drop_duplicates__()
self.__save__()
logger.info("Initialization complete.")

def __drop_duplicates__(self):
orig_contacts = self._contacts.copy()
for orig_contact in orig_contacts:
for contact in orig_contacts:
if contact == orig_contact:
self._contacts.remove(contact)



##########################
# Overrides:
##########################
Expand Down

0 comments on commit 01439fe

Please sign in to comment.