Closed i99dev closed 1 year ago
the wildcards check looks good to me ! it's a good start with wildcards .. but we need to add more conditions to it !
I have looked into the code and I have tested some of the cases .. and this is what I found..
1- This will work only for the cases when: the wildcard is applied only to nicknames
2- And it actually won't work on the following case
-> if referred to everyone ex. /msg "hey"
-> This kind of mask that will be needed later by invite and ban ex. nick!user@newtwork
-> `!@some.com or !@*`
And the main reason is because of _message->getMask() .. since it doesn't cover these cases .. so I think will be better to make this function bool match_wildCard(std::string const &str); with two parameters that give us the chance to pass another string for the mask
Good sound
l follow this link to start with wildcard, but if there any more special case need cover please let me know
/msg * "hi all"
IRSSI ignore it !
nick!user@newtwork -> !@some*.com or !@*
can you give me example msg please
@Saxsori
okay I thought this /msg * "hi all"
will work which it should,
but anyway when u refer to everyone on the server u use this *!*@*
.. mostly used to invite or ban specific users
for example :
and u can also use the wildcard in this way:
ab*
.. will refer to everyone starting with ab
check this.. it helped me to understand the cases
I'm not sure but I think this mask *!*@*
is not used with the commands that address the users by nicknames like PRIVMSG
Now it supports *
and ?
, and you interact with the user class only it there are any more requests, let me know, please.
message template
/msg user!nick@exmaple.com
different case:
/msg *dev hi mate
use only nickname. ✅/msg *!*dev hi mate
use username and nickname. ✅/msg *!*dev@*.edu hi mate
use username, nickname, host. ✅
if you want use with the invite for example :
Good news, wildcards support
*
and?
All methods come under the Message class
If you want to check if Messages have wildcard only, you can call
_message->getMask().size()
if > 0, that means wildcard function implementationThe type like
*
and?
if you want to check only call_message->getType()
for more understanding, you can check to commendPrivmsg
. There is an example if the user use/msg *dev hi all
--> will send message to all username end with dev ex:i99dev
There is a very important method call
bool match_wildCard(std::string const &str);
use to get what is value match and use it alsoPrivmsg
good example any questions please let me know