- modebuf_init(&mbuf, sptr, cptr, chptr,
- (MODEBUF_DEST_SERVER | /* Send mode to server */
- MODEBUF_DEST_HACK2 | /* Send a HACK(2) message */
- MODEBUF_DEST_BOUNCE)); /* And bounce the mode */
-
- modebuf_mode_client(&mbuf, MODE_ADD | MODE_CHANOP, sptr, MAXOPLEVEL + 1);
-
- modebuf_flush(&mbuf);
-
- badop = 1;
+ if (!IsBurstOrBurstAck(cli_user(sptr)->server)) {
+ modebuf_init(&mbuf, sptr, cptr, chptr,
+ (MODEBUF_DEST_SERVER | /* Send mode to server */
+ MODEBUF_DEST_HACK2 | /* Send a HACK(2) message */
+ MODEBUF_DEST_BOUNCE)); /* And bounce the mode */
+
+ modebuf_mode_client(&mbuf, MODE_ADD | MODE_CHANOP, sptr, MAXOPLEVEL + 1);
+
+ modebuf_flush(&mbuf);
+
+ badop = 1;
+ } else if (chanTS > chptr->creationtime + 4) {
+ /* If their handling of the BURST will lead to deopping the
+ * user, have the user join without getting ops (if the
+ * server's handling of the BURST keeps their ops, the channel
+ * will use our timestamp).
+ */
+ badop = 1;
+ }
+
+ if (badop)
+ joinbuf_join(&join, chptr, 0);