diff --git a/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt b/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt index 3be7bab4..73154717 100644 --- a/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt +++ b/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt @@ -267,6 +267,10 @@ class ChatLinesAdapter @MainThread constructor( onLinesChanged(Animation.LastLineAdded) } + @WorkerThread override fun onLineReplaced() { + onLinesChanged(Animation.None, diffLineContents = true) + } + @WorkerThread override fun onTitleChanged() { onLinesChanged() } diff --git a/app/src/main/java/com/ubergeek42/WeechatAndroid/fragments/BufferFragment.kt b/app/src/main/java/com/ubergeek42/WeechatAndroid/fragments/BufferFragment.kt index b87c6680..f6042656 100644 --- a/app/src/main/java/com/ubergeek42/WeechatAndroid/fragments/BufferFragment.kt +++ b/app/src/main/java/com/ubergeek42/WeechatAndroid/fragments/BufferFragment.kt @@ -483,6 +483,10 @@ class BufferFragment : Fragment(), BufferEye { linesAdapter?.onLineAdded() } + @WorkerThread override fun onLineReplaced() { + linesAdapter?.onLineReplaced() + } + @MainThread override fun onGlobalPreferencesChanged(numberChanged: Boolean) { linesAdapter?.onGlobalPreferencesChanged(numberChanged) } diff --git a/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/Buffer.kt b/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/Buffer.kt index d0cfcb58..88b7c39a 100644 --- a/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/Buffer.kt +++ b/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/Buffer.kt @@ -355,6 +355,10 @@ class Buffer @WorkerThread constructor( bufferEyes.forEach { it.onLineAdded() } } + @WorkerThread fun onLineReplaced() { + bufferEyes.forEach { it.onLineReplaced() } + } + var style = 0 @MainThread fun onGlobalPreferencesChanged(numberChanged: Boolean) { diff --git a/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferEye.kt b/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferEye.kt index 125c09e0..ab244c17 100644 --- a/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferEye.kt +++ b/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferEye.kt @@ -12,6 +12,9 @@ interface BufferEye { // 1 line added on bottom @WorkerThread fun onLineAdded() + // line was replaced via _buffer_line_data_changed + @WorkerThread fun onLineReplaced() + // indicates changed title @WorkerThread fun onTitleChanged() diff --git a/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferList.kt b/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferList.kt index 771aeea7..f13794a7 100644 --- a/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferList.kt +++ b/app/src/main/java/com/ubergeek42/WeechatAndroid/relay/BufferList.kt @@ -399,7 +399,7 @@ object BufferList { val spec = LineSpec(entry) findByPointer(spec.bufferPointer)?.let { buffer -> buffer.replaceLine(spec.toLine()) - buffer.onLinesListed() + buffer.onLineReplaced() } } }