<commit_before><?php

require_once(dirname(__FILE__)."/../pfccommand.class.php");

class pfcCommand_updatemynick extends pfcCommand
{
  function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid)
  {
    $c =& $this->c;
    $u =& $this->u;

    $container =& $c->getContainerInstance();

    $was_there = $container->updateNick($recipient, $u->nick);
    if (!$was_there)
    {
      /*
      @todo: write the timeout adjustment when the user object will be available
      if ($c->debug) pxlog("Cmd_updateMyNick[".$c->sessionid."]: nick ".$u->nick." updated but was not there, adjust timeout to ".$c->timeout, "chat", $c->getId());
      // adjust the timeout value dynamicaly for this user
      $c->timeout += $c->refresh_delay;
      $c->saveInCache();
      */
    }
  }
}

?><commit_msg>Bug fix: if the user is not present on the channel, call the createNick function in order to update the user metadata which are maybe nonexistent (no more ghost users).<commit_after><?php

require_once(dirname(__FILE__)."/../pfccommand.class.php");

class pfcCommand_updatemynick extends pfcCommand
{
  function run(&$xml_reponse, $clientid, $param, $sender, $recipient, $recipientid)
  {
    $c =& $this->c;
    $u =& $this->u;

    $container =& $c->getContainerInstance();
    $was_there = $container->updateNick($recipient, $u->nick);
    if (!$was_there)
    {
      // if the user were not in the list, it must be created in order to refresh his metadata
      // because when the user is timeouted, his metadata are destroyed.
      $container->createNick($recipient, $u->nick, $u->nickid);
      
      /*
      @todo: write the timeout adjustment when the user object will be available
      if ($c->debug) pxlog("Cmd_updateMyNick[".$c->sessionid."]: nick ".$u->nick." updated but was not there, adjust timeout to ".$c->timeout, "chat", $c->getId());
      // adjust the timeout value dynamicaly for this user
      $c->timeout += $c->refresh_delay;
      $c->saveInCache();
      */
    }
  }
}

?>
{'fraction_non_alphanumeric': 0.15669797330696986, 'fraction_numerical': 0.0, 'mean_word_length': 3.3063829787234043, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '230538', 'n_tokens_mistral': 666, 'n_tokens_neox': 645, 'n_words': 186}