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; 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")] [JsonProperty(@"sender_id")]
public int UserId; public int UserId;
[JsonProperty(@"target_type")] [JsonProperty(@"channel_id")]
public TargetType TargetType; public int ChannelId;
[JsonProperty(@"target_id")]
public int TargetId;
[JsonProperty(@"is_action")] [JsonProperty(@"is_action")]
public bool IsAction; 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()); careChannels.Find(c => c.Id == group.Key)?.AddNewMessages(group.ToArray());
lastMessageId = updates.Messages.LastOrDefault()?.Id ?? lastMessageId; lastMessageId = updates.Messages.LastOrDefault()?.Id ?? lastMessageId;
@ -534,8 +534,7 @@ namespace osu.Game.Overlays
{ {
Sender = api.LocalUser.Value, Sender = api.LocalUser.Value,
Timestamp = DateTimeOffset.Now, Timestamp = DateTimeOffset.Now,
TargetType = TargetType.Channel, //TODO: read this from channel ChannelId = target.Id,
TargetId = target.Id,
IsAction = isAction, IsAction = isAction,
Content = postText Content = postText
}; };