aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--protocols/twitter/twitter.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index 2cac166f..76625b3d 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -317,7 +317,7 @@ struct groupchat *twitter_groupchat_init(struct im_connection *ic)
tmp = set_getstr(&ic->acc->set, "channel_name");
- if (tmp == NULL) {
+ if (tmp == NULL || strlen(tmp) == 0) {
name_hint = g_strdup_printf("%s_%s", td->prefix, ic->acc->user);
} else {
name_hint = g_strdup(tmp);
@@ -527,7 +527,19 @@ static char *set_eval_commands(set_t * set, char *value)
static char *set_eval_channel_name(set_t * set, char *value)
{
- return value; // XXX: Validate somethig here?
+ size_t len;
+
+ if (value == NULL) {
+ return NULL;
+ }
+
+ len = strlen(value);
+
+ if (len < MAX_NICK_LENGTH && len > 0) {
+ return value;
+ } else {
+ return NULL;
+ }
}
static char *set_eval_mode(set_t * set, char *value)