Skip to content

Commit fa5e99d

Browse files
committed
Multi-SIM fixes
1 parent 3001af7 commit fa5e99d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ids/user.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ pub async fn register(config: &dyn OSConfig, aps: &APSState, id_services: &[&'st
10001000

10011001
let services = id_services.iter().map(|service| {
10021002
let mut user_list = vec![];
1003+
let mut sim_count = 0;
10031004
for user in users.iter() {
10041005
let handles = &possible_handles[&user.user_id];
10051006
let mut user_data = Dictionary::from_iter([
@@ -1020,7 +1021,8 @@ pub async fn register(config: &dyn OSConfig, aps: &APSState, id_services: &[&'st
10201021
("user-id", Value::String(user.user_id.to_string()))
10211022
].into_iter());
10221023
if let IDSUserType::Phone = user.user_type {
1023-
user_data.insert("tag".to_string(), Value::String("SIM".to_string()));
1024+
sim_count += 1;
1025+
user_data.insert("tag".to_string(), Value::String(format!("SIM{}", if sim_count == 1 { "".to_string() } else { sim_count.to_string() })));
10241026
}
10251027
user_list.push(Value::Dictionary(user_data));
10261028
}

0 commit comments

Comments
 (0)