diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2016-06-05 14:16:36 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2016-06-12 22:29:23 +0100 |
commit | 7a438c17063b92a23f9ab133a88097861a6f4527 (patch) | |
tree | bfe30e790be92d6c70bfd3eb8edd87134d028dbf /modules/core | |
parent | 900d62df078e136d108edce85f6ce2b0c852c6ac (diff) |
Add support for configurable initial channel modes
Diffstat (limited to 'modules/core')
-rw-r--r-- | modules/core/m_join.c | 20 |
1 files changed, 12 insertions, 8 deletions
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", |