Skip to content

Commit 04a3c77

Browse files
committed
fix(channels): case-insensitive channel-ID match in find_by_name
The channel-ID fallback lowercased the query but compared it against the raw (mixed-case) channel id with a case-sensitive contains(), so Teams conversation ids (which contain uppercase chars) never matched — breaking send_message_to_another_channel to Teams. Lowercase both sides.
1 parent ac52277 commit 04a3c77

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/conversation/channels.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,13 @@ impl ChannelStore {
164164
return Ok(Some(channel.clone()));
165165
}
166166

167-
// Match against the raw channel ID
168-
if let Some(channel) = channels.iter().find(|c| c.id.contains(&name_lower)) {
167+
// Match against the channel ID (case-insensitive: Teams conversation ids
168+
// contain uppercase chars, so compare the lowercased id against the
169+
// already-lowercased query rather than the raw id).
170+
if let Some(channel) = channels
171+
.iter()
172+
.find(|c| c.id.to_lowercase().contains(&name_lower))
173+
{
169174
return Ok(Some(channel.clone()));
170175
}
171176

0 commit comments

Comments
 (0)