pike.git / lib / modules / Protocols.pmod / IRC.pmod / Client.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/IRC.pmod/Client.pike:1:   #pike __REAL_VERSION__    - #if constant(Crypto.Random) -  +    import ".";      Raw raw;   //FIXME: Unknown what this default password is good for. Probably not needed. - string pass=MIME.encode_base64(Crypto.Random.random_string(6)); + string pass=MIME.encode_base64(random_string(6));      mapping options;      mapping channels=([]);      //! @decl void create(string|object server, void|mapping(string:mixed) options)   //! @param server   //! The IRC server to connect to.   //! If server is an object, it is assumed to be a newly established - //! connection to the IRC server to be used. Pass @[SSL.sslfile] + //! connection to the IRC server to be used. Pass @[SSL.File]   //! connections here to connect to SSL secured IRC networks.   //! @param options   //! An optional mapping with additional IRC client options.   //! @mapping   //! @member int "port"   //! Defaults to 6667.   //! @member string "user"   //! Defaults to @expr{"unknown"@} on systems without @[getpwuid] and   //! @[getuid] and to @expr{getpwuid(getuid())[0]@} on systems with.   //! @member string "nick"
pike.git/lib/modules/Protocols.pmod/IRC.pmod/Client.pike:40: Inside #if constant(Crypto.Random)
  //! to @expr{uname()->nodename@} on systems with.   //! @member int "ping_interval"   //! Defaults to 120.   //! @member int "ping_timeout"   //! Defaults to 120.   //! @member function(void:void) "connection_lost"   //! This function is called when the connection to the IRC server is   //! lost or when a ping isn't answered with a pong within the time   //! set by the @tt{ping_timeout@} option. The default behaviour is   //! to complain on stderr and self destruct. + //! @member program "channel_program" + //! An instance of this is created for each channel connected to via + //! join_channel() - should be a subclass of Protocols.IRC.Channel.   //! @member function(mixed ...:void) "error_notify"   //! This function is called when a KILL or ERROR command is recieved   //! from the IRC server.   //! @member function(string,void|string:void) "system_notify"   //!   //! @member function(string,void|string:void) "motd_notify"   //!   //! @member function(string) "error_nickinuse"   //!   //! @member function(string,string,string,string,string) "generic_notify"
pike.git/lib/modules/Protocols.pmod/IRC.pmod/Client.pike:381:    case "INVITE":    if ((c=channels[lower_case(message||"")]))    {    c->not_invite(originator,@extra);    return;    }    if (!options->notice_invite) break;    options->notice_invite(originator,message,@extra);    return;    +  case "CAP": +  if (message=="ACK") +  { +  if (!options->capability_notify) break; +  options->capability_notify(from, to, extra); +  return; +  } +  break; +  + #ifdef IRC_DEBUG    default:    werror("got unknown message: %O, %O, %O, %O\n",from,type,to,message); -  + #endif    }   // werror("got notify: %O, %O, %O, %O\n",from,type,to,message);    if (options->generic_notify)    options->generic_notify(from,type,to,message,    (extra&&sizeof(extra))?extra[0]:0);   }      object cmd=class   {    object raw;
pike.git/lib/modules/Protocols.pmod/IRC.pmod/Client.pike:485:    }   } (raw);      // ----- commands      void send_message(string|array to,string msg)   {    cmd->privmsg( (arrayp(to)?to*",":to), msg);   }    + void join_channel(string chan) + { +  cmd->join(chan); +  if (options->channel_program) +  { +  object ch = options->channel_program(); +  ch->name = lower_case(chan); +  channels[lower_case(chan)] = ch; +  } + } +  + void part_channel(string chan) + { +  cmd->part(chan); +  m_delete(channels, lower_case(chan)); + } +    // ----- persons      class Person   {    inherit .Person;       void say(string message)    {    cmd->privmsg(nick,message);    }
pike.git/lib/modules/Protocols.pmod/IRC.pmod/Client.pike:543:    if (ip && !p->ip)    sscanf(ip,"%*[~]%s@%s",p->user,p->ip);       return p;   }      void forget_person(object p)   {    m_delete(nick2person,p->nick);   } -  - #else - constant this_program_does_not_exist=1; - #endif // constant(Crypto.Random.random_string) +