diff --git a/doc/soju.1.scd b/doc/soju.1.scd index 6286c5c..54804d2 100644 --- a/doc/soju.1.scd +++ b/doc/soju.1.scd @@ -37,6 +37,9 @@ soju supports two connection modes: a channel, you need to use the suffix too: _/join #channel/network_. Same applies to messages sent to users. +For per-client history to work, clients need to indicate their name. This can +be done by adding a "@" suffix to the username. + # OPTIONS *-h, -help* diff --git a/downstream.go b/downstream.go index 4f898cc..cf6f55b 100644 --- a/downstream.go +++ b/downstream.go @@ -540,10 +540,18 @@ func unmarshalUsername(rawUsername string) (username, client, network string) { username = rawUsername[:i] } if j >= 0 { - network = rawUsername[j+1:] + if rawUsername[j] == '@' { + client = rawUsername[j+1:] + } else { + network = rawUsername[j+1:] + } } if i >= 0 && j >= 0 && i < j { - client = rawUsername[i+1 : j] + if rawUsername[i] == '@' { + client = rawUsername[i+1 : j] + } else { + network = rawUsername[i+1 : j] + } } return username, client, network