-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Nick highlighting broken in MUCs #1578
Comments
From my MUC chat log: public static Pattern generateNickHighlightPattern(final String nick) {
return Pattern.compile("(?<=(^|\\s))" + Pattern.quote(nick) + "(?=\\s|$|\\p{Punct})");
} this is what Conversations does. The nick surrounded by punctuation and white spaces. I am not aware of any flaws of this pattern matching. The way profanity did it before, was good too. |
I will take a look about the bug later. |
That's not exactly what i meant. I think the user will not come up with better regexes than the community. I just think Conversations has a pretty good pattern that can be taken as default in our codebase. If somebody comes up with a better regex, it should be merged in master and not stay hidden in some users local config file. Nevertheless highlighting is broken right now in 11.0 and master. |
The bug is about regexes. So that's exactly what you meant. Whether they are custom made from the user for no matter which word or whether we will add a default for the neck based on a regex is another topic.
LIke I said: |
Is it possible that this is actually only working correctly since 6bc440c ? There is: |
@kaffeekanne ping I still think that the behaviour only works properly now. If you agree then I guess it makes sense to that we will set |
Set PREF_NOTIFY_MENTION_WHOLE_WORD to true. If I'm not mistaken the _mucwin_print_mention() / get_mentions() functions only work correctly since 6bc440c. This changed the behaviour for users. They got notified when their nick was `kaffee` and in the message the string `kaffeekanne` occured. Setting `/notify room mention word_whole` corrected this. So my idea is that only now the mention function work correctly. And to have a good default behaviour we should set the `word_whole` on by default. Regards #1578
Since no feedback I assumed my ideas were right and set |
Up until recent changes the nick highlighting was pretty solid. Meaning if the nick was sourrounded by whitespaces or puntuation the highlighting was triggered. Since some commits, every occurance of the nick as substring of any word can trigger highlighting. Using short ambigious nicks leads to many false positive highlights.
Expected Behavior
A nick should only be highlighted if it is sourrounded by whitespace or punctuation (including brackets and quotation marks). Let the nick be
kaffee
, a message containingkaffeekanne
should not trigger a highlighting.Current Behavior
Let the nick be
kaffee
, a message containging the wordkaffeekanne
will be highlighted.Possible Solution
Probably a regex that behaves more like the former one. Check how other Clients deal with this, Conversations and Gajim have pretty highlighting, with rare false positives.
Probably the current behaviour was intruduced by 6bc440c .
Steps to Reproduce (for bugs)
Context
I get a lot of mentions and therefore unnecessary updates in console window and status window.
Environment
profanity -v
The text was updated successfully, but these errors were encountered: