}
}
+bool_t getBoolConf(param_t param)
+{
+ config_setting_t *setting = NULL;
+
+ switch (param) {
+ case ALLOW_TEXTMESSAGE:
+ setting = config_lookup(&configuration, "allow_textmessage");
+ if (!setting)
+ return true;
+ else
+ return config_setting_get_bool(setting);
+ break;
+ default:
+ doAssert(false);
+ }
+}
+
int Conf_getNextChannel(conf_channel_t *chdesc, int index)
{
config_setting_t *setting = NULL;
LOGFILE,
ADMIN_PASSPHRASE,
BAN_LENGTH,
+ ALLOW_TEXTMESSAGE,
} param_t;
typedef struct {
const char *getStrConf(param_t param);
int getIntConf(param_t param);
+bool_t getBoolConf(param_t param);
int Conf_getNextChannel(conf_channel_t *chdesc, int index);
int Conf_getNextChannelLink(conf_channel_link_t *chlink, int index);
break;
case TextMessage:
+ if (!getBoolConf(ALLOW_TEXTMESSAGE))
+ break;
msg->payload.textMessage->has_actor = true;
msg->payload.textMessage->actor = client->sessionId;
case PermissionQuery:
Msg_inc_ref(msg); /* Re-use message */
msg->payload.permissionQuery->has_permissions = true;
+
if (client->isAdmin)
msg->payload.permissionQuery->permissions = PERM_ADMIN;
else
msg->payload.permissionQuery->permissions = PERM_DEFAULT;
+ if (!getBoolConf(ALLOW_TEXTMESSAGE))
+ msg->payload.permissionQuery->permissions &= ~PERM_TEXTMESSAGE;
+
Client_send_message(client, msg);
break;
case UDPTunnel: