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

Use glob matching for activity_hide_targets #437

Merged
merged 2 commits into from
Mar 21, 2016
Merged

Use glob matching for activity_hide_targets #437

merged 2 commits into from
Mar 21, 2016

Conversation

vague666
Copy link
Member

No description provided.

char **tmp;
int index;

g_return_val_if_fail(array != NULL, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, to be honest it might be better to return -1 instead of 0 to follow the return index ofitem' in array' or -1 if not found principle.
(This also applies to strarray_find)

@LemonBoy
Copy link
Member

This deserves a mention in the docs.

@LemonBoy LemonBoy added needs changes auto-merge This PR is scheduled for merge if no further comments are opened and removed needs changes labels Mar 13, 2016
spaces vs tabs!

strarray_find* needs to return -1 if no index found
@LemonBoy
Copy link
Member

From RFC 2812

Channels names are strings (beginning with a '&', '#', '+' or '!'
   character) of length up to fifty (50) characters.  Apart from the
   requirement that the first character is either '&', '#', '+' or '!',
   the only restriction on a channel name is that it SHALL NOT contain
   any spaces (' '), a control G (^G or ASCII 7), a comma (',').  Space
   is used as parameter separator and command is used as a list item
   separator by the protocol).  A colon (':') can also be used as a
   delimiter for the channel mask.  Channel names are case insensitive.

and Glib's documentation

Note that in contrast to glob(), the '/' character can be matched by the wildcards, there are no '[...]' character ranges and '*' and '?' can not be escaped to include them literally in a pattern. 

With the attached patch you have no way to reference a channel containing a * or a ?.

@LemonBoy LemonBoy added needs changes and removed auto-merge This PR is scheduled for merge if no further comments are opened labels Mar 17, 2016
@ailin-nemui
Copy link
Contributor

it may have unfortunate consequences if you want to ignore activity in the channel #*

@vague666
Copy link
Member Author

Ah, thanks, yes, we don't want that, maybe we can just skip the matching if
ignore targets is a * or tag/*

/Jari
On Mar 17, 2016 10:04 PM, "ailin-nemui" notifications@github.com wrote:

it may have unfortunate consequences if you want to ignore activity in the
channel #*


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#437 (comment)

@ailin-nemui
Copy link
Contributor

I think this is fine now, @LemonBoy ?

@ailin-nemui ailin-nemui added auto-merge This PR is scheduled for merge if no further comments are opened and removed needs changes labels Mar 20, 2016
ailin-nemui added a commit that referenced this pull request Mar 21, 2016
Use glob matching for activity_hide_targets
@ailin-nemui ailin-nemui merged commit f765864 into irssi:master Mar 21, 2016
@ailin-nemui ailin-nemui added this to the 1.0.0 milestone Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge This PR is scheduled for merge if no further comments are opened
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants