Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnecting to hub or using history command shows custom commands by users #27

Open
nishithshah2211 opened this issue Jan 30, 2015 · 4 comments

Comments

@nishithshah2211
Copy link
Member

When a user reconnects to hub or uses +history command, custom commands used by users who are mods or below are also displayed, which should not happen.

@hjpotter92
Copy link
Member

Ideally, yes. The current code has:

local sCmd, sData = sMessage:match( "%b<> [-+*/?!#](%w+)%s?(.*)|" )

which returns false positives for messages like +1, *sorry, #some-or-other-hash-tag. It needs a more complex solution than the one you suggest in the pull request.

@nishithshah2211
Copy link
Member Author

Yes, I didn't think of that at all. We can maintain a table of commands and then check if sCmd is in the table or not and proceed accordingly.

@nishithshah2211
Copy link
Member Author

Are there commands that do not start with a + or ! or /? I was thinking we could use this:

local sCmd, sData = sMessage:match( "%b<> [+/!](%w+)%s?(.*)|" )

@hjpotter92
Copy link
Member

The character set [-+*/?!#] implies that I can use ANY of those characters for the commands. So, all of the following are equivalent:

!help
+help
/help
#help
?help
*help
-help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants