- /* NOTE: Moved this below the fake direction check, so that modes
- * arent put into the mode list for users that were collided, and
- * may reconnect from the other side or our side before the split
- * is completed!
- */
-
- /* Did they get any modes? How many times? */
- strlcat(modestring, nm, MAXBUF);
- for (int k = 0; k < ntimes; k++)
- mode_users[modectr++] = strdup(usr);
- /* Free temporary buffer used for mode sequence */
- delete[] nm;
-
- /* Finally, we can actually place the user into the channel.
- * We're sure its right. Final answer, phone a friend.
- */
- if (created)
- chanrec::JoinUser(this->Instance, who, channel.c_str(), true, "", TS);
- else
- chanrec::JoinUser(this->Instance, who, channel.c_str(), true, "");
- /* Have we already queued up MAXMODES modes with parameters
- * (+qaohv) ready to be sent to the server?
- */
- if (modectr >= (MAXMODES-1))
- {
- /* Only actually give the users any status if we lost
- * the FJOIN or drew (equal timestamps).
- * It isn't actually possible for ourTS to be > TS here,
- * only possible to actually have ourTS == TS, or
- * ourTS < TS, because if we lost, we already lowered
- * our TS above before we entered this loop. We only
- * check >= as a safety measure, in case someone stuffed
- * up. If someone DID stuff up, it was most likely me.
- * Note: I do not like baseball bats in the face...
- */
- if (ourTS >= TS)
- {
- this->Instance->SendMode((const char**)mode_users,modectr,who);
-
- /* Something stuffed up, and for some reason, the timestamp is
- * NOT lowered right now and should be. Lower it. Usually this
- * code won't be executed, doubtless someone will remove it some
- * day soon.
- */
- if (ourTS > TS)
- {
- Instance->Log(DEFAULT,"Channel TS for %s changed from %lu to %lu",chan->name,ourTS,TS);
- chan->age = TS;
- ourTS = TS;
- }
- }
-
- /* Reset all this back to defaults, and
- * free any ram we have left allocated.
- */
- strcpy(mode_users[1],"+");
- for (unsigned int f = 2; f < modectr; f++)
- free(mode_users[f]);
- modectr = 2;
- }