Commit 6008f90
committed
Refactor
message callbacks
* Added a new member `m_viewingConvId` to `ChatEditor` to keep the ID of
the conversation currently being displayed.
* Updated the `currentEditorChanged` signal handler to set
`m_viewingConvId` and use it instead of a local `convId`. The handler
now early‑returns when the signal originates from a different editor
instance.
* Updated all callbacks that receive a `Message` (`onMessageAppended`,
`onPendingMessageChanged`) and the follow‑up widget creation to ignore
messages whose `convId` does not match `m_viewingConvId`.
These changes ensure that each editor instance only processes messages
for its own conversation, preventing cross‑talk between editors when the
user switches tabs. This also makes the code clearer by explicitly
storing the conversation context.ChatEditor to track the current conversation ID and guard1 parent db38ea2 commit 6008f90
2 files changed
+26
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 159 | + | |
| 160 | + | |
172 | 161 | | |
173 | | - | |
| 162 | + | |
| 163 | + | |
174 | 164 | | |
175 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
176 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
288 | 289 | | |
289 | 290 | | |
290 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
291 | 295 | | |
292 | 296 | | |
293 | 297 | | |
| |||
426 | 430 | | |
427 | 431 | | |
428 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
429 | 436 | | |
430 | 437 | | |
431 | 438 | | |
| |||
513 | 520 | | |
514 | 521 | | |
515 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
516 | 526 | | |
517 | 527 | | |
518 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
0 commit comments