1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Fix outdated API variable

This commit is contained in:
Dean Herbert 2018-09-28 19:33:19 +09:00
parent 6841d5c2ec
commit 3cacc11af1
3 changed files with 5 additions and 9 deletions

View File

@ -27,6 +27,6 @@ namespace osu.Game.Online.API.Requests
return req;
}
protected override string Target => $@"chat/channels/{message.TargetId}/messages";
protected override string Target => $@"chat/channels/{message.ChannelId}/messages";
}
}

View File

@ -18,11 +18,8 @@ namespace osu.Game.Online.Chat
[JsonProperty(@"sender_id")]
public int UserId;
[JsonProperty(@"target_type")]
public TargetType TargetType;
[JsonProperty(@"target_id")]
public int TargetId;
[JsonProperty(@"channel_id")]
public int ChannelId;
[JsonProperty(@"is_action")]
public bool IsAction;

View File

@ -462,7 +462,7 @@ namespace osu.Game.Overlays
}
}
foreach (var group in updates.Messages.Where(m => m.TargetType == TargetType.Channel).GroupBy(m => m.TargetId))
foreach (var group in updates.Messages.GroupBy(m => m.ChannelId))
careChannels.Find(c => c.Id == group.Key)?.AddNewMessages(group.ToArray());
lastMessageId = updates.Messages.LastOrDefault()?.Id ?? lastMessageId;
@ -534,8 +534,7 @@ namespace osu.Game.Overlays
{
Sender = api.LocalUser.Value,
Timestamp = DateTimeOffset.Now,
TargetType = TargetType.Channel, //TODO: read this from channel
TargetId = target.Id,
ChannelId = target.Id,
IsAction = isAction,
Content = postText
};