RFC 2812 prefix parsing
Brought to you by:
meebey
Prefix parsing according to RFC 2812 2.3.1.
Now it is possible to distinguish origin of messages
(user or server) by empty $ircdata->nick, ident or host
fields.
---
prefix = servername / ( nickname [ [ "!" user ] "@"
host ] )
---
this could also be done by regex
"|^([^.\s]+)((!(\S+))?@(\S+))?$|U"
$1 - nick, $4 - ident, $5 - host
something like this
if (preg_match("|^([^.\s]+)((!(\S+))?@(\S+))?$|U",
$from, $matches)) {
$ircdata->nick = $matches[1];
$ircdata->ident = $matches[4];
$ircdata->host = $matches[5]
}
$ircdata->from = $from;
patch without regexp
Logged In: YES
user_id=669020
forgot to add - patch attached