From 7a438c17063b92a23f9ab133a88097861a6f4527 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 5 Jun 2016 14:16:36 +0100 Subject: Add support for configurable initial channel modes --- modules/core/m_join.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'modules/core') diff --git a/modules/core/m_join.c b/modules/core/m_join.c index b31779d..833bebb 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -214,26 +214,30 @@ m_join(struct Client *client_p, struct Client *source_p, */ if (flags & CHFL_CHANOP) { + char modebuf[MODEBUFLEN]; + char parabuf[MODEBUFLEN]; + chptr->channelts = CurrentTime; - chptr->mode.mode |= MODE_TOPICLIMIT; - chptr->mode.mode |= MODE_NOPRIVMSGS; + chptr->mode.mode |= ConfigChannel.default_modes; + + channel_modes(chptr, &me, modebuf, parabuf); sendto_server(client_p, CAP_TS6, NOCAPS, - ":%s SJOIN %lu %s +nt :@%s", + ":%s SJOIN %lu %s %s %s:@%s", me.id, (unsigned long)chptr->channelts, - chptr->chname, source_p->id); + chptr->chname, modebuf, parabuf, source_p->id); sendto_server(client_p, NOCAPS, CAP_TS6, - ":%s SJOIN %lu %s +nt :@%s", + ":%s SJOIN %lu %s %s %s:@%s", me.name, (unsigned long)chptr->channelts, - chptr->chname, source_p->name); + chptr->chname, modebuf, parabuf, source_p->name); /* * notify all other users on the new channel */ sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s!%s@%s JOIN :%s", source_p->name, source_p->username, source_p->host, chptr->chname); - sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s +nt", - me.name, chptr->chname); + sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s %s", + me.name, chptr->chname, modebuf); if (source_p->away[0]) sendto_channel_local_butone(source_p, 0, CAP_AWAY_NOTIFY, chptr, ":%s!%s@%s AWAY :%s", -- cgit