1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 12:07:23 +08:00
Commit Graph

273 Commits

Author SHA1 Message Date
Dean Herbert
c190c68659 Add safety for channel with no messages 2020-01-13 12:22:44 +09:00
Craftplacer
8cc2d70df0 Reduce API calls by checking what message was last marked as read 2020-01-12 16:24:14 +01:00
Craftplacer
ccaf4e48a1 Remove using directive 2020-01-11 20:04:58 +01:00
Craftplacer
2ea1367a88 Remove message parameter and make it mark the entire channel as read 2020-01-11 19:47:35 +01:00
Craftplacer
f8a11e50b6 Remove redundant ToString() calls
as string interpolation does this automatically..
2020-01-11 18:00:34 +01:00
Craftplacer
d9c57baa89 Add test case for mismatch of channels 2020-01-11 17:48:03 +01:00
Craftplacer
50e357a799 Change method parameters, add detailed error message and method docs 2020-01-11 17:42:02 +01:00
Craftplacer
cd679707ed
Prevent channel duplicates
Co-Authored-By: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2020-01-11 17:16:11 +01:00
Craftplacer
cd91cc860d Resolve "Redundant lambda signature parentheses" 2020-01-04 01:06:38 +01:00
Craftplacer
4f36bc0fd3 Add error log message for debugging 2020-01-04 00:49:35 +01:00
Craftplacer
7b71e56817 Initial commit 2020-01-02 17:07:28 +01:00
Huo Yaoyuan
e9b8cbb516 Apply other styles. 2019-11-11 20:27:04 +08:00
Dean Herbert
898520935e Move link handling code to OsuGame
This allows for future calls from arguments / associations
2019-11-01 11:40:51 +09:00
Dean Herbert
d1c6e3f620 Add test for scroll to end when max history is exceeded 2019-10-29 14:32:52 +09:00
Bartłomiej Dach
661dfbefaf Change containment check to overlap
Due to scenarios wherein a formatted link ended up as part of a larger
raw link after parsing, change the containment check to an overlap check
and add appropriate tests for these edge cases.
2019-10-25 00:42:58 +02:00
Bartłomiej Dach
cbd99cc767 Resolve link-in-link edge case
Testing with #6542 surfaced a crash scenario, caused by formatted links
that had URLs in the display text, for example

    [mean example - https://osu.ppy.sh](https://osu.ppy.sh)

In that case the outer Markdown link would get picked up once, and then
reduced to the link text when looking for other links, leading to it
being picked up again the second time when the raw link is found.

Add a check in the raw link parsing path that ensures that the found
URL is not a part of a bigger, pre-existing link.
2019-10-24 15:52:55 +02:00
Bartłomiej Dach
24b7160522 Add support for parsing Markdown inline links
Extend the Markdown parsing regex to allow parsing so-called inline
links. Within the parenthesis () part of the Markdown URL syntax,
introduce a new capturing group:

    (
      \s+              // whitespace between actual URL and inline title
      (?<title>        // start of "title" named group
        ""             // opening double quote (doubled inside @ string)
        (
          [^""]        // any character but a double quote
          |            // or
          (?<=\\)      // the next character should be preceded by a \
          ""           // a double quote
        )*             // zero or more times
        ""             // closing double quote
      )
    )?                 // the whole group is optional

This allows for parsing the inline links as-provided by web. Correctness
is displayed by the passing tests.
2019-10-24 15:52:55 +02:00
Dean Herbert
c3375071ad Fix formatting issue 2019-10-23 00:26:47 +09:00
Dean Herbert
e9aa7f3218 Subclass and use yellow for stand-alone chat display 2019-10-23 00:24:19 +09:00
Andrei Zavatski
bb7af1e39c Fix some margin/padding issues 2019-10-22 01:45:04 +03:00
Andrei Zavatski
d19041fa53 Implement DaySeparator class 2019-10-22 01:30:37 +03:00
Dan Balasescu
b161aa22c3
Merge branch 'master' into simplify-exit-logic-of-screens 2019-10-02 18:13:57 +09:00
Ganendra Afrasya
b6dd610af8 Apply reviews 2019-10-01 23:18:03 +07:00
Joehu
5f700f2ae9 Simplify exit logic of screens with textboxes using back button receptor 2019-10-01 08:26:34 -07:00
Ganendra Afrasya
208b9a4eba Add new virtual float for username to timestamp padding 2019-10-01 20:47:53 +07:00
Bartłomiej Dach
08350a1aca Add parenthesis handling to old link format
Allow users to put both balanced round parentheses, as well as
unbalanced escaped ones, in old style link text. The implementation
is the same as for Markdown and new style links, except for swapping
all instances of

    \[\]

to

    \(\)

for obvious reasons (different type of parenthesis requiring escaping).
Tests also included.
2019-09-04 00:21:27 +02:00
Bartłomiej Dach
f04add6d9e Add bracket handling to Markdown link format
Allow users to put both balanced brackets, as well as unbalanced
escaped ones, in Markdown link text. The implementation is the exact
same as in the case of new format links.

For completion's sake, tests also included.
2019-09-04 00:07:00 +02:00
Bartłomiej Dach
24d4f0372c Refactor link parsing regexes to use named groups
For the sake of readability, consistency and to make further changes
easier, introduce named groups (?<text>) and (?<url>) to all link
parsing regexes which have parts containing the desired link text
and (optionally) URL.

The introduction of the named groups additionally simplifies
handleMatches() and makes all calls to it consistent.
2019-09-04 00:06:52 +02:00
Bartłomiej Dach
a8f16503e2 Add backslash escaping to new link format
For users to be able to add square brackets inside of links using
the new format, the regular expression used for parsing those links
contained a balancing group, which can be used for matching pairs
of tokens (in this case, opening and closing brackets, in that order).
However, this means that users could not post links with unmatched
brackets inside of them (ie. ones that contain single brackets, or
a closing bracket and then an opening one). Allow for escaping opening
and closing brackets using the backslash character.

The change substitutes this old fragment of the regex in the display
text group:

    [^\[\]]*        // any character other than closing/opening bracket

for this one:

    (((?<=\\)[\[\]])|[^\[\]])*

The second pattern in the alternative remains the same; the first one
performs the escaping, as follows:

    (
        (?<=\\)     // positive lookbehind expression:
                    // this match will succeed, if the next expression
                    // is preceded by a single backslash
        [\[\]]      // either an opening or closing brace
    )

Since the entire display group is matched, unfortunately the lookbehind
expression does not actually strip the backslashes, so they are
manually stripped in handleMatches.

As demonstrated in the unit tests attached, this also allows balanced
brackets to be mixed with escaped ones.
2019-09-03 23:18:39 +02:00
Andrei Zavatski
015406f4d2 Fix link parser 2019-08-18 22:02:59 +03:00
Dan Balasescu
bb90a273ac
Merge branch 'master' into system-user-color 2019-08-08 19:02:24 +09:00
Dean Herbert
6d5a7041fd Move system user colour assignment to ensure consistency 2019-08-08 17:10:06 +09:00
Max Hübner
0bed3bfece formatting inspection 2 2019-08-08 09:02:09 +02:00
Max Hübner
bcd443a3aa remove /j 2019-08-08 08:56:52 +02:00
Max Hübner
ffb6794b4e formatting inspection 2019-08-06 16:11:13 +02:00
Max Hübner
2f5d23b354 add join command 2019-08-05 01:02:42 +02:00
Dean Herbert
4a25a84975 Fix DrawableChannel async flow 2019-06-20 23:01:39 +09:00
Dean Herbert
5bb8649f3b Remove unused property from chat message 2019-06-18 14:22:59 +09:00
Arphox
07e17518e9 Fix all "Maintainability" CodeFactor issues 2019-06-11 10:28:16 +02:00
LeNitrous
4e6d7137aa disallow current user from opening their own private channel 2019-06-03 17:25:19 +08:00
Dean Herbert
bc962bf8f0 Move TooltipText to OsuClickableContainer 2019-05-21 13:51:38 +09:00
Paul Teng
7adaa09263 Move tab channel class into tab item class 2019-05-12 06:31:11 -04:00
Paul Teng
d53fb9a5c8 Check against type instead of channel name 2019-05-12 06:11:16 -04:00
Paul Teng
6cf1ca288f
Do not try to join the Add-channel button 2019-05-11 19:13:48 -04:00
smoogipoo
d7c09e7dbd Merge remote-tracking branch 'origin/master' into fix-new-inspections
# Conflicts:
#	osu.Game.Rulesets.Catch/Judgements/CatchDropletJudgement.cs
#	osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs
#	osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs
#	osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs
#	osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
#	osu.Game.Tests/Visual/SongSelect/TestCaseBeatmapScoresContainer.cs
#	osu.Game/Graphics/OsuFont.cs
#	osu.Game/Online/API/Requests/Responses/APILegacyScoreInfo.cs
#	osu.Game/Overlays/Profile/Header/BadgeContainer.cs
#	osu.Game/Overlays/Profile/ProfileHeader.cs
#	osu.Game/Screens/Select/PlaySongSelect.cs
#	osu.Game/Skinning/LegacySkinDecoder.cs
2019-05-07 13:20:17 +09:00
smoogipoo
0bd35ab7bb Turn on warnings, resolve issues 2019-04-25 17:36:17 +09:00
Dean Herbert
612db31c38 Apply newline additions 2019-04-01 12:16:32 +09:00
Dean Herbert
26d53d06a9 Fix remaining issues 2019-02-28 13:31:40 +09:00
Dean Herbert
367bc53a06 Revert some more instances of 'e' variable names 2019-02-22 20:15:25 +09:00
smoogipoo
d8c55bc729 Adjust namespaces 2019-02-21 19:05:52 +09:00