Commit 9bae337
committed
fix(android): treat saved contacts as saved peers for notifications
When "Received Message" is disabled but "Message from Saved Peer" is
enabled, no notification was posted for messages from saved peers saved
via "Save to Contacts" (Chats long-press, Messaging star), QR import,
or manual entry.
MessageCollector resolved the saved-peer flag exclusively from the
legacy announces.isFavorite column, but only the announce-stream star
path sets that column. The other save paths write to the contacts
table via ContactRepository and never touch the flag, so isFavorite
reached NotificationHelper as false and the general-toggle-off gate
silently dropped the notification.
Resolve saved-peer status from both signals: the legacy announce
favorite flag OR membership in the active identity's contacts table.
Lookup failures keep the existing fail-safe default.
Regression test: MessageCollectorTest covers a contacts-table-only
saved peer (announce isFavorite = false, hasContact = true) and
asserts notifyMessageReceived is called with isFavorite = true.1 parent c179b0b commit 9bae337
2 files changed
Lines changed: 80 additions & 14 deletions
File tree
- app/src
- main/java/network/columba/app/service
- test/java/network/columba/app/service
Lines changed: 35 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 146 | + | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
| |||
274 | 268 | | |
275 | 269 | | |
276 | 270 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 271 | + | |
284 | 272 | | |
285 | 273 | | |
286 | 274 | | |
| |||
458 | 446 | | |
459 | 447 | | |
460 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
461 | 482 | | |
462 | 483 | | |
463 | 484 | | |
| |||
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
373 | 418 | | |
374 | 419 | | |
375 | 420 | | |
| |||
0 commit comments