prefs refactoring: partial implementation (wip)
[brisk.git] / web / Obj / brisk.phh
index e3abaa9..7262ef4 100644 (file)
@@ -1416,9 +1416,9 @@ class Brisk
 
     $ret = sprintf('gst.st = %d; ',  $user_step);
 
-    $prefs = Client_prefs::from_user($user);
-    $ret .= sprintf('prefs_load(\'%s\', false, false);', json_encode($prefs));
-
+    if ($user->is_auth()) {
+        $ret .= sprintf('g_prefsn.load(\'%s\');', json_encode($user->prefsn_get()));
+    }
     if(false) {
         if ($user->flags & USER_FLAG_ISOLAUTH) {
             $ret .= 'list_set(\'isolation\', false, \''.$mlang_brisk['tit_onisol'][$G_lang].'\' ); ';
@@ -2152,6 +2152,20 @@ class Brisk
             echo $this->info_show($user, urldecode($info_user), $dt);
         } while(0);
     }
+    else if (strncmp($msg, "/prefsn", 7) == 0) {
+        do {
+            if (! $user->is_auth()) {
+                if ($mlang_indwr) {
+                    $to_user = nickserv_msg($dt, $mlang_indwr['info_auth'][$G_lang]);
+                }
+                else {
+                    $to_user = nickserv_msg($dt, "error");
+                }
+                break;
+            }
+            echo $this->prefsn_show($user, $dt);
+        } while(0);
+    }
     else if (strncmp($msg, "/st ", 4) == 0) {
       log_main("chatt_send BEGIN");