"Encap", "EOB", "Error", "Join", "Kick", "Kill", "Mode", "Nick",
"Notice", "Part", "Pass", "Ping", "Privmsg", "Quit", "Server", "SID",
"SJoin", "SQuit", "Stats", "TMode", "UID", "Whois", "Operwall", "Invite",
+ "BMask"
};
static
--- /dev/null
+/*
+ * Copyright (C) 2017 Kristina Brooks. All rights reserved.
+ *
+ * Support for TS6 BMASK
+ * Message format: chanTS, chan, type, space separated masks
+ * Plexus only supports +b, +e and +I.
+ */
+
+package net.rizon.acid.messages;
+
+import net.rizon.acid.core.Acidictive;
+import net.rizon.acid.core.Channel;
+import net.rizon.acid.core.Message;
+import net.rizon.acid.core.Server;
+import net.rizon.acid.core.User;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BMask extends Message
+{
+ private static final Logger log = LoggerFactory.getLogger(BMask.class);
+
+ public BMask()
+ {
+ super("BMASK");
+ }
+
+ /*
+ * TS6 spec says that if the TS in the BMASK is greater, the message
+ * should be dropped. do that check here.
+ */
+ private boolean shouldDropMessage(Channel chan, String newTS) {
+ try
+ {
+ return (Integer.parseInt(newTS) > chan.getTS());
+ }
+ catch (NumberFormatException ex)
+ {
+ ex.printStackTrace();
+ return true;
+ }
+ }
+
+ @Override
+ public void onServer(Server server, String[] params)
+ {
+ Channel chan = Channel.findChannel(params[1]);
+ if (chan == null || shouldDropMessage(chan, params[0]))
+ return;
+
+ char mode = params[2].charAt(0);
+
+ String[] splitMasks = params[3].split(" ");
+ for (String mask : splitMasks)
+ {
+ chan.changeMaskMode(mode, true, mask);
+ }
+ }
+}
\ No newline at end of file