mirror of https://gitlab.com/bashrc2/epicyon
Change terminology to avoid confusion
parent
d393b29b1f
commit
94c0541119
|
@ -413,15 +413,15 @@ def download_conversation_posts(authorized: bool, session,
|
||||||
return conversation_view + replies_to_post
|
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
|
"""Converts a converation tag, such as
|
||||||
tag:domain,2024-09-28:objectId=647832678:objectType=Conversation
|
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):
|
if not isinstance(tag, str):
|
||||||
return ''
|
return ''
|
||||||
thread_id = ''
|
convthread_id = ''
|
||||||
for tag_chr in tag:
|
for tag_chr in tag:
|
||||||
if tag_chr.isdigit():
|
if tag_chr.isdigit():
|
||||||
thread_id += tag_chr
|
convthread_id += tag_chr
|
||||||
return thread_id
|
return convthread_id
|
||||||
|
|
10
tests.py
10
tests.py
|
@ -225,7 +225,7 @@ from reading import get_book_link_from_content
|
||||||
from reading import get_book_from_post
|
from reading import get_book_from_post
|
||||||
from reading import get_reading_status
|
from reading import get_reading_status
|
||||||
from reading import store_book_events
|
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
|
TEST_SERVER_GROUP_RUNNING = False
|
||||||
|
@ -9042,12 +9042,12 @@ def _test_bridgy() -> None:
|
||||||
assert domain == 'brid.gy'
|
assert domain == 'brid.gy'
|
||||||
|
|
||||||
|
|
||||||
def _test_conversation_to_thread() -> None:
|
def _test_conversation_to_convthread() -> None:
|
||||||
print('conversation to thread')
|
print('conversation to thread')
|
||||||
conversation_id = \
|
conversation_id = \
|
||||||
'tag:domain,2024-09-28:objectId=647832678:objectType=Conversation'
|
'tag:domain,2024-09-28:objectId=647832678:objectType=Conversation'
|
||||||
thread_id = conversation_tag_to_thread_id(conversation_id)
|
convthread_id = conversation_tag_to_convthread_id(conversation_id)
|
||||||
assert thread_id == '20240928647832678'
|
assert convthread_id == '20240928647832678'
|
||||||
|
|
||||||
|
|
||||||
def run_all_tests():
|
def run_all_tests():
|
||||||
|
@ -9068,7 +9068,7 @@ def run_all_tests():
|
||||||
_test_checkbox_names()
|
_test_checkbox_names()
|
||||||
_test_thread_functions()
|
_test_thread_functions()
|
||||||
_test_functions()
|
_test_functions()
|
||||||
_test_conversation_to_thread()
|
_test_conversation_to_convthread()
|
||||||
_test_bridgy()
|
_test_bridgy()
|
||||||
_test_link_tracking()
|
_test_link_tracking()
|
||||||
_test_remove_tags()
|
_test_remove_tags()
|
||||||
|
|
Loading…
Reference in New Issue