Change terminology to avoid confusion

main
Bob Mottram 2024-10-06 13:22:52 +01:00
parent d393b29b1f
commit 94c0541119
2 changed files with 10 additions and 10 deletions

View File

@ -413,15 +413,15 @@ def download_conversation_posts(authorized: bool, session,
return conversation_view + replies_to_post
def conversation_tag_to_thread_id(tag: str) -> str:
def conversation_tag_to_convthread_id(tag: str) -> str:
"""Converts a converation tag, such as
tag:domain,2024-09-28:objectId=647832678:objectType=Conversation
into a thread id such as 20240928647832678
into a convthread id such as 20240928647832678
"""
if not isinstance(tag, str):
return ''
thread_id = ''
convthread_id = ''
for tag_chr in tag:
if tag_chr.isdigit():
thread_id += tag_chr
return thread_id
convthread_id += tag_chr
return convthread_id

View File

@ -225,7 +225,7 @@ from reading import get_book_link_from_content
from reading import get_book_from_post
from reading import get_reading_status
from reading import store_book_events
from conversation import conversation_tag_to_thread_id
from conversation import conversation_tag_to_convthread_id
TEST_SERVER_GROUP_RUNNING = False
@ -9042,12 +9042,12 @@ def _test_bridgy() -> None:
assert domain == 'brid.gy'
def _test_conversation_to_thread() -> None:
def _test_conversation_to_convthread() -> None:
print('conversation to thread')
conversation_id = \
'tag:domain,2024-09-28:objectId=647832678:objectType=Conversation'
thread_id = conversation_tag_to_thread_id(conversation_id)
assert thread_id == '20240928647832678'
convthread_id = conversation_tag_to_convthread_id(conversation_id)
assert convthread_id == '20240928647832678'
def run_all_tests():
@ -9068,7 +9068,7 @@ def run_all_tests():
_test_checkbox_names()
_test_thread_functions()
_test_functions()
_test_conversation_to_thread()
_test_conversation_to_convthread()
_test_bridgy()
_test_link_tracking()
_test_remove_tags()