diff --git a/components/app.js b/components/app.js index b97a490..b6a697f 100644 --- a/components/app.js +++ b/components/app.js @@ -764,6 +764,15 @@ export default class App extends Component { target = msg.prefix.name; } } + + var allowedPrefixes = client.isupport.get("STATUSMSG"); + if (allowedPrefixes) { + var parts = irc.parseTargetPrefix(target, allowedPrefixes); + if (this.isChannel(parts.name)) { + target = parts.name; + } + } + this.addMessage(serverID, target, msg); break; case "JOIN": diff --git a/lib/irc.js b/lib/irc.js index d7ebe03..34df11b 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -210,11 +210,10 @@ export function formatMessage(msg) { } /** Split a prefix and a name out of a target. */ -export function parseTargetPrefix(s) { - // TODO: use the PREFIX token from RPL_ISUPPORT +export function parseTargetPrefix(s, allowedPrefixes = STD_MEMBERSHIPS) { var i; for (i = 0; i < s.length; i++) { - if (STD_MEMBERSHIPS.indexOf(s[i]) < 0) { + if (allowedPrefixes.indexOf(s[i]) < 0) { break; } }