Merge pull request #6553 from osmandapp/TelegramImprovements
Fix live now messages updates
This commit is contained in:
commit
7dd22ddd94
2 changed files with 13 additions and 5 deletions
|
@ -59,6 +59,7 @@
|
|||
android:id="@+id/details_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="2dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -86,7 +87,7 @@
|
|||
android:maxLines="1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/list_item_description_text_size"
|
||||
app:firstBaselineToTopHeight="@dimen/list_item_baseline_to_top_height"
|
||||
app:firstBaselineToTopHeight="@dimen/list_item_icon_margin_right"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="213 m" />
|
||||
|
||||
|
@ -116,7 +117,7 @@
|
|||
android:maxLines="1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/list_item_description_text_size"
|
||||
app:firstBaselineToTopHeight="@dimen/list_item_baseline_to_top_height"
|
||||
app:firstBaselineToTopHeight="@dimen/list_item_icon_margin_right"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="@string/shared_string_group" />
|
||||
|
||||
|
@ -153,7 +154,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/list_item_description_text_size"
|
||||
app:firstBaselineToTopHeight="@dimen/list_item_baseline_to_top_height_small"
|
||||
app:firstBaselineToTopHeight="18dp"
|
||||
app:typeface="@string/font_roboto_medium"
|
||||
tools:text="213 m"
|
||||
tools:textColor="@color/ctrl_active_light"/>
|
||||
|
@ -167,7 +168,7 @@
|
|||
android:textColor="?attr/android:textColorSecondary"
|
||||
android:textSize="@dimen/list_item_description_text_size"
|
||||
android:visibility="visible"
|
||||
app:firstBaselineToTopHeight="@dimen/list_item_icon_margin_right" />
|
||||
app:firstBaselineToTopHeight="18dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -180,7 +181,7 @@
|
|||
android:maxLines="1"
|
||||
android:textColor="?attr/android:textColorSecondary"
|
||||
android:textSize="@dimen/list_item_description_text_size"
|
||||
app:firstBaselineToTopHeight="@dimen/list_item_icon_margin_right"
|
||||
app:firstBaselineToTopHeight="18dp"
|
||||
app:typeface="@string/font_roboto_regular"
|
||||
tools:text="Live: 1 • All: 36"/>
|
||||
|
||||
|
|
|
@ -1282,6 +1282,12 @@ class TelegramHelper private constructor() {
|
|||
TdApi.UpdateMessageEdited.CONSTRUCTOR -> {
|
||||
val updateMessageEdited = obj as TdApi.UpdateMessageEdited
|
||||
lastTelegramUpdateTime = Math.max(lastTelegramUpdateTime, updateMessageEdited.editDate)
|
||||
val message = usersLocationMessages[updateMessageEdited.messageId]
|
||||
if (message != null) {
|
||||
synchronized(message) {
|
||||
message.editDate = updateMessageEdited.editDate
|
||||
}
|
||||
}
|
||||
}
|
||||
TdApi.UpdateMessageContent.CONSTRUCTOR -> {
|
||||
val updateMessageContent = obj as TdApi.UpdateMessageContent
|
||||
|
@ -1295,6 +1301,7 @@ class TelegramHelper private constructor() {
|
|||
synchronized(message) {
|
||||
lastTelegramUpdateTime = Math.max(lastTelegramUpdateTime, Math.max(message.date, message.editDate))
|
||||
message.content = updateMessageContent.newContent
|
||||
message.content = OsmandLocationUtils.parseMessageContent(message, this@TelegramHelper)
|
||||
}
|
||||
incomingMessagesListeners.forEach {
|
||||
it.onReceiveChatLocationMessages(message.chatId, message)
|
||||
|
|
Loading…
Reference in a new issue