HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Conversations

It seems users a limited to only having 5 people per conversation (unless you are an admin). Is there a way to increase this?

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    From class.conversationmodel.php:


       /**
        * Get how many recipients current user can send a message to.
        *
        * @return int|bool A maximum number of recipients or FALSE for unlimited.
        */
       public static function getMaxRecipients() {
           // Moderators can add as many as they want.
           if (Gdn::session()->checkRankedPermission('Garden.Moderation.Manage')) {
               return false;
           }
    
           // Start conservative.
           $maxRecipients = c('Conversations.MaxRecipients', 5);
    


    So $Configuration['Conversations']['MaxRecipients'] = false; will allow addressing unlimited recipients or $Configuration['Conversations']['MaxRecipients'] = 42; will allow "only" 42.

    By the way: my favorite hidden Conversations feature can be enable with that entry in the config.php: $Configuration['Conversations']['Subjects']['Visible'] = true;

  • This is awesome, and the hidden subject thing is a bonus that ill use. Someone should keep a post of all the hidden configuration options and what they do!!

  • R_JR_J Ex-Fanboy Munich Admin

    Well, that would be a huge task. Not sure how it would be started best or how it should be presented. Maybe in a GitHub repo, but how should it be structured? Alphabetically?



    I wrote a script a while ago to get all the configs which are used in the source code. That could definetely be a start. It's ugly and not commented, but it works:

    <?php
    
    $path = __DIR__.'/master';
    
    $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
    foreach($objects as $name => $object){
       if ($object->getExtension() != 'php' || $object->isReadable() != true) {
           continue;
       }
       $file = $object->openFile('r');
       $content = $file->fread($file->getSize());
       $tokens = token_get_all($content);
    
       // parser part
       $count = count($tokens);
       for ($i = 0; $i < $count; $i++) {
           $token = $tokens[$i];
           if (!is_array($token)){
               continue;
           }
    
           // Only interested in T_STRING
           if ($token[0] != T_STRING) {
               continue;
           }
           // Only interested in 'c' and 'gdn'
           if (strtolower($token[1]) === 'c' && $tokens[$i + 1] === '(') {
               if ($tokens[$i + 2][0] == T_CONSTANT_ENCAPSED_STRING) { // T_CONSTANT_ENCAPSED_STRING
                   echo '"', trim($tokens[$i + 2][1], '\'"'), '","', __FILE__, '"', PHP_EOL;
               }
           } elseif (strtolower($token[1]) === 'gdn') {
               if (
                   is_array($tokens[$i + 1]) &&
                   $tokens[$i + 1][1] === '::' &&
                   is_array($tokens[$i + 1]) &&
                   strtolower($tokens[$i + 2][1]) === 'config' &&
                   $tokens[$i + 4] = '('
               ) {
                   if ($tokens[$i + 5][0] == T_CONSTANT_ENCAPSED_STRING) { // T_CONSTANT_ENCAPSED_STRING
                       echo '"', trim($tokens[$i + 5][1], '\'"'), '","', __FILE__, '"', PHP_EOL;
                   }
               }
           }
       }
    }
    


  • Looks like a good start to me... Having this documented is extremely important. Maybe we can add it to the GitHub documentation repository and just keep updating it as we figure out what each one does. Let me see what I can do to get us started!

  • R_JR_J Ex-Fanboy Munich Admin

    It doesn't fit to the official documentation since the configuration file isn't accessible for the cloud hosted forums. I would suggest a dedicated public git repo

Sign In or Register to comment.