- if ($only_you) {
- $to_user = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape("== chat ban =="));
- }
- else {
- $to_user = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape($msg));
- // temporary silentiation for troll (will became array check)
- // if (strcasecmp($user->name,'JackRokka') != 0 && $user->sess != '47ea653f602e8')
- $to_room = $to_user;
- }
+ log_main("chatt_send start set");
+ if (($user->flags & USER_FLAG_S_ALL) != $st) {
+ $update_room = TRUE;
+ $user->flags = ($user->flags & ~USER_FLAG_S_ALL) | $st;
+ }
+ } while (0);
+ } // nick chat command
+
+ else { // normal chat line
+ $is_normchat = TRUE;
+ if (CHAT_ENABLED && $curtime < ($user->chat_ban + $user->chat_dlt)) {
+ $only_you = TRUE;
+ $user->chat_dlt = $user->chat_dlt * 2;
+ if ($user->chat_dlt > 120)
+ $user->chat_dlt = 120;
+ }
+ else if ($user->chat_lst == $msg)
+ $only_you = TRUE;
+ else if (CHAT_ENABLED && $curtime - $user->chattime[($user->chat_cur + 1) % CHAT_N] < CHAT_ILL_TIME) {
+ $user->chat_ban = $curtime;
+ $user->chat_dlt = 5;
+ $only_you = TRUE;
+ }
+ else {
+ $user->chat_ban = 0;
+ $user->chat_dlt = 0;
+ }
+
+ if ($only_you) {
+ $to_user = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape("== chat ban =="));
+ }
+ else {
+ // TEMPORARY DISABLED UNTIL test user option will be available
+ // if ( TRUE && (!$user->is_auth() || $user->is_appr()) ) {
+ if (!$user->is_auth()) {
+ $to_user = nickserv_msg($dt, xcape("Visto l'elevato numero di molestatori che ultimamente hanno preso dimora su Brisk abbiamo deciso"));
+ $to_user .= nickserv_msg($dt, xcape("di disattivare temporaneamente la chat in room per i non registrati, non ce ne vogliate e buone feste."));
+ if (FALSE) {
+ $aug_head = array("Tanti", "Tantissimi", "Un enormità", "Un milione", "Un' esagerazione");
+ $aug_body = array("a tutti gli utenti", "a tutti gli uomini", "a tutte le donne", "a tutti gli utenti");
+ $aug_tail = array("di Brisk", "del sito", "della ciurma", "della comitiva", "del gruppo");
+
+ $auguri = sprintf("%s auguri %s %s.",
+ $aug_head[mt_rand(0, count($aug_head)-1)],
+ $aug_body[mt_rand(0, count($aug_body)-1)],
+ $aug_tail[mt_rand(0, count($aug_tail)-1)]);
+
+ $to_room = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name),
+ xcape($auguri));
+ }
+ }
+ else {
+ $to_user = sprintf('chatt_sub("%s",[%d,"%s"],"%s");', $dt, $user->flags, xcape($user->name), xcape($msg));
+ // temporary silentiation for troll (will became array check)
+ // if (strcasecmp($user->name,'JackRokka') != 0 && $user->sess != '47ea653f602e8')
+ $to_room = $to_user;
+ }
+ }