Skip to content

Commit

Permalink
Merge pull request #192 from squidowl/fix/mode
Browse files Browse the repository at this point in the history
fix MODE command
  • Loading branch information
casperstorm authored Aug 3, 2023
2 parents b1a9cb0 + b186de9 commit 25ff16d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Changed:
Fixed:

- Set the window application id on Linux to `org.squidowl.halloy`
- Correctly display all arguments when receiving MODE command

# 2023.3 (2023-07-27)

Expand Down
10 changes: 8 additions & 2 deletions data/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,21 @@ fn text(message: &Encoded, our_nick: &Nick) -> Option<String> {
(user.nickname() != *our_nick)
.then(|| format!("⟶ {} has joined the channel", user.formatted()))
}
Command::MODE(target, modes, _) if proto::is_channel(target) => {
Command::MODE(target, modes, args) if proto::is_channel(target) => {
let user = user?;
let modes = modes
.iter()
.map(|mode| mode.to_string())
.collect::<Vec<_>>()
.join(" ");

Some(format!(" ∙ {user} sets mode {modes}"))
let args = args
.iter()
.map(|arg| arg.to_string())
.collect::<Vec<_>>()
.join(" ");

Some(format!(" ∙ {user} sets mode {modes} {args}"))
}
Command::PRIVMSG(_, text) => {
// Check if a synthetic action message
Expand Down

0 comments on commit 25ff16d

Please sign in to comment.