mirror of
https://github.com/osukey/osukey.git
synced 2025-05-20 21:17:32 +09:00
Handle links correctly and don't re-open profile if the user is same.
This commit is contained in:
parent
bb40919f9c
commit
75fdca928e
@ -210,13 +210,13 @@ namespace osu.Game.Online.Chat
|
|||||||
return inputMessage;
|
return inputMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Link> GetLinks(string text)
|
public static MessageFormatterResult FormatText(string text)
|
||||||
{
|
{
|
||||||
var result = format(text);
|
var result = format(text);
|
||||||
|
|
||||||
result.Links.Sort();
|
result.Links.Sort();
|
||||||
|
|
||||||
return result.Links;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MessageFormatterResult
|
public class MessageFormatterResult
|
||||||
|
@ -34,8 +34,8 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
|||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
|
||||||
userLinkTemplate = $"[{activity.User?.Username}]({urlToAbsolute(activity.User?.Url)})";
|
userLinkTemplate = $"[{urlToAbsolute(activity.User?.Url)} {activity.User?.Username}]";
|
||||||
beatmapLinkTemplate = $"[{activity.Beatmap?.Title}]({urlToAbsolute(activity.Beatmap?.Url)})";
|
beatmapLinkTemplate = $"[{urlToAbsolute(activity.Beatmap?.Url)} {activity.Beatmap?.Title}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -59,9 +59,9 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
|
|||||||
Colour = OsuColour.Gray(0xAA),
|
Colour = OsuColour.Gray(0xAA),
|
||||||
});
|
});
|
||||||
|
|
||||||
string text = activityToString();
|
var formatted = MessageFormatter.FormatText(activityToString());
|
||||||
|
|
||||||
content.AddLinks(text, MessageFormatter.GetLinks(text));
|
content.AddLinks(formatted.Text, formatted.Links);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateLeftVisual()
|
protected override Drawable CreateLeftVisual()
|
||||||
|
@ -75,6 +75,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public void ShowUser(long userId)
|
public void ShowUser(long userId)
|
||||||
{
|
{
|
||||||
|
if (userId == Header.User.Id)
|
||||||
|
return;
|
||||||
|
|
||||||
ShowUser(new User { Id = userId }, true);
|
ShowUser(new User { Id = userId }, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user