Format location event for debugging purpose

This commit is contained in:
Maxime NATUREL 2022-05-02 15:00:17 +02:00
parent 3a36762632
commit d341611e54
2 changed files with 9 additions and 7 deletions

View File

@ -100,7 +100,7 @@ class TimelineItemFactory @Inject constructor(
// Message itemsX
EventType.STICKER,
in EventType.POLL_START,
EventType.MESSAGE -> messageItemFactory.create(params)
EventType.MESSAGE -> messageItemFactory.create(params)
EventType.REDACTION,
EventType.KEY_VERIFICATION_ACCEPT,
EventType.KEY_VERIFICATION_START,
@ -113,14 +113,15 @@ class TimelineItemFactory @Inject constructor(
EventType.CALL_NEGOTIATE,
EventType.REACTION,
in EventType.POLL_RESPONSE,
in EventType.POLL_END -> noticeItemFactory.create(params)
in EventType.POLL_END -> noticeItemFactory.create(params)
// Calls
EventType.CALL_INVITE,
EventType.CALL_HANGUP,
EventType.CALL_REJECT,
EventType.CALL_ANSWER -> callItemFactory.create(params)
EventType.CALL_ANSWER -> callItemFactory.create(params)
in EventType.BEACON_LOCATION_DATA -> noticeItemFactory.create(params)
// Crypto
EventType.ENCRYPTED -> {
EventType.ENCRYPTED -> {
if (event.root.isRedacted()) {
// Redacted event, let the MessageItemFactory handle it
messageItemFactory.create(params)
@ -129,11 +130,11 @@ class TimelineItemFactory @Inject constructor(
}
}
EventType.KEY_VERIFICATION_CANCEL,
EventType.KEY_VERIFICATION_DONE -> {
EventType.KEY_VERIFICATION_DONE -> {
verificationConclusionItemFactory.create(params)
}
// Unhandled event types
else -> {
else -> {
// Should only happen when shouldShowHiddenEvents() settings is ON
Timber.v("Type ${event.root.getClearType()} not handled")
defaultItemFactory.create(params)

View File

@ -107,7 +107,8 @@ class NoticeEventFormatter @Inject constructor(
EventType.REDACTION,
EventType.STICKER,
in EventType.POLL_RESPONSE,
in EventType.POLL_END -> formatDebug(timelineEvent.root)
in EventType.POLL_END,
in EventType.BEACON_LOCATION_DATA -> formatDebug(timelineEvent.root)
else -> {
Timber.v("Type $type not handled by this formatter")
null