-
Notifications
You must be signed in to change notification settings - Fork 80
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
Clickable URLs in KI Chat and KI Mail. #890
Conversation
Very cool! I see you also improved the color of the links that I was a little worried about in your previous video. Looking great now. But I wonder if this
might ruffle some feathers. While the fact that anyone can edit a KI message is probably rather an accidental side effect than an intentional feature, and is undesirable more often than not, collaborative editing can sometimes be a useful feature that people may have gotten used to. Taking it away, and especially sacrificing it to something as pointless as censoring, seems a questionable bargain to me. |
Yeah, @DamnBriggsy brought that up in IRC. I intend to make a post about it in the OU and Cyan discords, but it's hard to do when my demonstration video includes rule breaking content 😞. Several other developers think that KI mails being editable by non-owners is a bug in general, so I'm wondering if an alternate path is available. For example, changing the KI mail interface to include a reply button. To my mind, this is better because, presently, you have to manually check your KI mails individually for new content. Also, it neatly fixes the issue where a troll can simply delete the entire content of your message. |
The right answer is to build a proper permission system, so that kimails can be either simple messages OR shared community posts, as-needed But I'm obviously not gonna build that. I only swoop in to make your lives harder.😉 |
You still have naughty words escaping the filter then 😛 |
Yeah, but you know how I feel about the filter. I barely believe in the consistency of the game world 😛 |
Rebased to merge without conflicts. |
Scripts/Python/xGUILinkHandler.py
Outdated
self.clearBuffer() | ||
self.insertString(text, censorLevel=censorLevel, urlDetection=urlDetection) | ||
# Emulate the real behavior of setString() - this to ensure we don't get duplicate | ||
# cursors if the string is rest while the control is being focused (eg text notes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"if the string is rest"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now 😄
This doesn't actually implement links, it just adds some core functionality that we will eventually require.
The docstring specifically says to NOT spin-wash the encoded buffer in Python. IME, the invisible control characters can become visible as garbage as a result.
We cannot censor the contents of KI mail in the vault. This would cause URLs containing naughty words to be irrevocably broken, linking to somewhere other than the original link. As a side effect, we now lock the editing of KI mail to its creator (or sender) to prevent naughty words escaping the censor.
@Deledrius One last change to add link support to the release notes dialog. Still look good? |
Looks good to me. |
This implements clickable URLs in KI chat and KI mail. This is done by adding a new control code to the
pfGUIMultiLineEditCtrl
that indicates a "link". The actual detection and handling of these links is done in Python where the rest of the text handling is done. Note that due to technical limitations, there are some behavior changes in the KI. Specifically, KI mail is no longer censored in the vault. Rather, it is censored at display time to prevent the corruption of URLs containing censored words. Further, KI mail can only be edited by the sender, preventing a trivial opportunity to escape the naughty word censor... When edit mode is activated, all censored words become unmasked.Demonstration video here
Depends on:
Fix MultiLineEdit IPointToPosition fencepost issue. #889So merge those first.