mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
Add support for STATUSMSG
Closes: https://todo.sr.ht/~emersion/gamja/65
This commit is contained in:
parent
3b5b693403
commit
6e20ad872e
2 changed files with 11 additions and 3 deletions
|
@ -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":
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue