+ const char *reply_format = get_language_string(user, text);
+ if(reply_format == NULL)
+ reply_format = text;
+ loadUserSettings(user);
+ char formatBuf[MAXLEN];
+ sprintf(formatBuf, "%s %s :%s", ((user->flags & USERFLAG_REPLY_PRIVMSG) ? "PRIVMSG" : "NOTICE"), user->nick, reply_format);
+ va_list arg_list;
+ char sendBuf[MAXLEN];
+ int pos;
+ if (!(client->flags & SOCKET_FLAG_CONNECTED)) return;
+ sendBuf[0] = '\0';
+ va_start(arg_list, text);
+ pos = vsnprintf(sendBuf, MAXLEN - 2, formatBuf, arg_list);
+ va_end(arg_list);
+ if (pos < 0 || pos > (MAXLEN - 2)) pos = MAXLEN - 2;
+ sendBuf[pos] = '\n';
+ sendBuf[pos+1] = '\0';
+ write_socket(client, sendBuf, pos+1);