Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Add the ability to recognise the ACTION CTCP command #2

Merged
merged 3 commits into from
Feb 6, 2013
Merged

Add the ability to recognise the ACTION CTCP command #2

merged 3 commits into from
Feb 6, 2013

Conversation

unlobito
Copy link
Contributor

@unlobito unlobito commented Feb 5, 2013

Hi there,

This is a simple one-line fix to add support for the ACTION CTCP command.

Tested this using the following code:

<?php
require 'src/Phergie/Irc/ParserInterface.php';
require 'src/Phergie/Irc/Parser.php';

$parser = new \Phergie\Irc\Parser();
print_r($parser->parse(":henri!~hwatson@henriwatson.com PRIVMSG #test :".chr(01)."ACTION test".chr(01)."\r\n"));

Which should output the following:

Array
(
    [prefix] => :henri!~hwatson@henriwatson.com
    [nick] => henri
    [user] => ~hwatson@henriwatson.com
    [command] => PRIVMSG
    [params] => Array
        (
            [all] => #test :ACTION test
            [receivers] => #test
            [text] => ACTION test
        )

    [message] => :henri!~hwatson@henriwatson.com PRIVMSG #test :ACTION test

    [targets] => Array
        (
            [0] => #test
        )

    [ctcp] => Array
        (
            [command] => ACTION
            [params] => Array
                (
                    [all] => test
                )

        )

)

Thanks!

@unlobito
Copy link
Contributor Author

unlobito commented Feb 5, 2013

Added the test case in 8658c0a.

@elazar
Copy link
Member

elazar commented Feb 6, 2013

Sorry, I wasn't clear; I actually meant for you to add it above the FINGER section. :) I have the test cases organized by the command they address. Your added ACTION case is now in the middle of the FINGER section. The test case itself looks good, it just needs to be moved to its own section and commented appropriately. Thanks!

@unlobito
Copy link
Contributor Author

unlobito commented Feb 6, 2013

No worries! Took care of that in d38176b.

elazar added a commit that referenced this pull request Feb 6, 2013
Add the ability to recognise the ACTION CTCP command, add support for underscores in nicks per RFC 2818 Section 2.3.1
@elazar elazar merged commit f01c2cd into phergie:master Feb 6, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants