diff options
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c index 8e36808a4b..fef6de504a 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1514,4 +1514,17 @@ set_ref_in_channel(int copyID) } return abort; } + +/* + * Return the mode of channel "idx". + * If "idx" is invalid returns MODE_JSON. + */ + ch_mode_T +channel_get_mode(int idx) +{ + if (idx < 0 || idx >= channel_count) + return MODE_JSON; + return channels[idx].ch_mode; +} + #endif /* FEAT_CHANNEL */ |