@@ -3736,6 +3736,12 @@ impl App {
37363736 if let Some ( ref name) = msg. source_name {
37373737 self . contact_names . entry ( msg. source . clone ( ) ) . or_insert_with ( || name. clone ( ) ) ;
37383738 }
3739+ // Populate UUID->name for @mention resolution
3740+ if let ( Some ( ref uuid) , Some ( ref name) ) = ( & msg. source_uuid , & msg. source_name ) {
3741+ if !name. is_empty ( ) {
3742+ self . uuid_to_name . entry ( uuid. clone ( ) ) . or_insert_with ( || name. clone ( ) ) ;
3743+ }
3744+ }
37393745 }
37403746
37413747 // Resolve conversation name: prefer message metadata, then contact lookup, then raw ID
@@ -4687,6 +4693,14 @@ impl App {
46874693 for ( phone, uuid) in & group. member_uuids {
46884694 self . number_to_uuid . entry ( phone. clone ( ) ) . or_insert_with ( || uuid. clone ( ) ) ;
46894695 }
4696+ // Populate UUID->name from group members (phone->uuid + phone->name)
4697+ for ( phone, uuid) in & group. member_uuids {
4698+ if let Some ( name) = self . contact_names . get ( phone) {
4699+ if !name. is_empty ( ) {
4700+ self . uuid_to_name . entry ( uuid. clone ( ) ) . or_insert_with ( || name. clone ( ) ) ;
4701+ }
4702+ }
4703+ }
46904704 // Store group for @mention member lookup
46914705 self . groups . insert ( group. id . clone ( ) , group. clone ( ) ) ;
46924706 // Groups are always "active" (you're a member), so create conversations
@@ -7146,6 +7160,7 @@ mod tests {
71467160 let msg = SignalMessage {
71477161 source : "+15551234567" . to_string ( ) ,
71487162 source_name : None ,
7163+ source_uuid : None ,
71497164 timestamp : chrono:: Utc :: now ( ) ,
71507165 body : Some ( "hey" . to_string ( ) ) ,
71517166 attachments : vec ! [ ] ,
@@ -7177,6 +7192,7 @@ mod tests {
71777192 let msg = SignalMessage {
71787193 source : "+1" . to_string ( ) ,
71797194 source_name : Some ( "Alice" . to_string ( ) ) ,
7195+ source_uuid : None ,
71807196 timestamp : chrono:: Utc :: now ( ) ,
71817197 body : Some ( "hi" . to_string ( ) ) ,
71827198 attachments : vec ! [ ] ,
@@ -7216,6 +7232,7 @@ mod tests {
72167232 let msg = SignalMessage {
72177233 source : "+1" . to_string ( ) ,
72187234 source_name : None ,
7235+ source_uuid : None ,
72197236 timestamp : chrono:: Utc :: now ( ) ,
72207237 body : Some ( "hello!" . to_string ( ) ) ,
72217238 attachments : vec ! [ ] ,
@@ -7249,6 +7266,7 @@ mod tests {
72497266 let msg = SignalMessage {
72507267 source : "+1" . to_string ( ) ,
72517268 source_name : Some ( "Alice" . to_string ( ) ) ,
7269+ source_uuid : None ,
72527270 timestamp : chrono:: Utc :: now ( ) ,
72537271 body : Some ( "hey family" . to_string ( ) ) ,
72547272 attachments : vec ! [ ] ,
@@ -7283,6 +7301,7 @@ mod tests {
72837301 let msg = SignalMessage {
72847302 source : "+1" . to_string ( ) ,
72857303 source_name : Some ( "Alice" . to_string ( ) ) ,
7304+ source_uuid : None ,
72867305 timestamp : chrono:: Utc :: now ( ) ,
72877306 body : Some ( "msg" . to_string ( ) ) ,
72887307 attachments : vec ! [ ] ,
@@ -8189,6 +8208,7 @@ mod tests {
81898208 let msg = SignalMessage {
81908209 source : "+1" . to_string ( ) ,
81918210 source_name : Some ( "Alice" . to_string ( ) ) ,
8211+ source_uuid : None ,
81928212 timestamp : chrono:: Utc :: now ( ) ,
81938213 body : Some ( "hello" . to_string ( ) ) ,
81948214 attachments : vec ! [ ] ,
@@ -8282,6 +8302,7 @@ mod tests {
82828302 let msg = SignalMessage {
82838303 source : "+1" . to_string ( ) ,
82848304 source_name : Some ( "Alice" . to_string ( ) ) ,
8305+ source_uuid : None ,
82858306 timestamp : chrono:: Utc :: now ( ) ,
82868307 body : Some ( "hello" . to_string ( ) ) ,
82878308 attachments : vec ! [ ] ,
@@ -8322,6 +8343,7 @@ mod tests {
83228343 let msg = SignalMessage {
83238344 source : "+1" . to_string ( ) ,
83248345 source_name : Some ( "Alice" . to_string ( ) ) ,
8346+ source_uuid : None ,
83258347 timestamp : chrono:: Utc :: now ( ) ,
83268348 body : Some ( "hello" . to_string ( ) ) ,
83278349 attachments : vec ! [ ] ,
@@ -8370,6 +8392,7 @@ mod tests {
83708392 let msg = SignalMessage {
83718393 source : "+1" . to_string ( ) ,
83728394 source_name : Some ( "Alice" . to_string ( ) ) ,
8395+ source_uuid : None ,
83738396 timestamp : chrono:: Utc :: now ( ) ,
83748397 body : Some ( "hello" . to_string ( ) ) ,
83758398 attachments : vec ! [ ] ,
@@ -8759,6 +8782,7 @@ mod tests {
87598782 let msg = SignalMessage {
87608783 source : "+1" . to_string ( ) ,
87618784 source_name : Some ( "Alice" . to_string ( ) ) ,
8785+ source_uuid : None ,
87628786 timestamp : chrono:: Utc :: now ( ) ,
87638787 body : Some ( "\u{FFFC} check this" . to_string ( ) ) ,
87648788 attachments : vec ! [ ] ,
@@ -8923,6 +8947,7 @@ mod tests {
89238947 let msg1 = SignalMessage {
89248948 source : "+15551234567" . to_string ( ) ,
89258949 source_name : Some ( "Alice" . to_string ( ) ) ,
8950+ source_uuid : None ,
89268951 timestamp : chrono:: Utc :: now ( ) ,
89278952 body : Some ( "first" . to_string ( ) ) ,
89288953 attachments : vec ! [ ] ,
@@ -8950,6 +8975,7 @@ mod tests {
89508975 let msg2 = SignalMessage {
89518976 source : "+15551234567" . to_string ( ) ,
89528977 source_name : Some ( "Alice" . to_string ( ) ) ,
8978+ source_uuid : None ,
89538979 timestamp : chrono:: Utc :: now ( ) ,
89548980 body : Some ( "second" . to_string ( ) ) ,
89558981 attachments : vec ! [ ] ,
@@ -8979,6 +9005,7 @@ mod tests {
89799005 let msg = |body : & str , ts_ms : i64 | SignalMessage {
89809006 source : "+15551234567" . to_string ( ) ,
89819007 source_name : Some ( "Alice" . to_string ( ) ) ,
9008+ source_uuid : None ,
89829009 timestamp : DateTime :: from_timestamp_millis ( ts_ms) . unwrap ( ) ,
89839010 body : Some ( body. to_string ( ) ) ,
89849011 attachments : vec ! [ ] ,
@@ -9016,6 +9043,7 @@ mod tests {
90169043 let msg = |body : & str , ts_ms : i64 | SignalMessage {
90179044 source : "+15551234567" . to_string ( ) ,
90189045 source_name : Some ( "Alice" . to_string ( ) ) ,
9046+ source_uuid : None ,
90199047 timestamp : DateTime :: from_timestamp_millis ( ts_ms) . unwrap ( ) ,
90209048 body : Some ( body. to_string ( ) ) ,
90219049 attachments : vec ! [ ] ,
@@ -9286,6 +9314,7 @@ mod tests {
92869314 SignalMessage {
92879315 source : source. to_string ( ) ,
92889316 source_name : None ,
9317+ source_uuid : None ,
92899318 timestamp : chrono:: Utc :: now ( ) ,
92909319 body : Some ( "hello" . to_string ( ) ) ,
92919320 attachments : vec ! [ ] ,
@@ -9319,6 +9348,7 @@ mod tests {
93199348 let msg = SignalMessage {
93209349 source : "+10000000000" . to_string ( ) ,
93219350 source_name : None ,
9351+ source_uuid : None ,
93229352 timestamp : chrono:: Utc :: now ( ) ,
93239353 body : Some ( "hey" . to_string ( ) ) ,
93249354 attachments : vec ! [ ] ,
@@ -9691,6 +9721,7 @@ mod tests {
96919721 SignalMessage {
96929722 source : source. to_string ( ) ,
96939723 source_name : None ,
9724+ source_uuid : None ,
96949725 timestamp : chrono:: Utc :: now ( ) ,
96959726 body : body. map ( |s| s. to_string ( ) ) ,
96969727 attachments : vec ! [ ] ,
0 commit comments