Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dfac771

Browse files
committed
Merge branch 'release'
2 parents fcdec0b + c364126 commit dfac771

File tree

3 files changed

+6
-34
lines changed

3 files changed

+6
-34
lines changed

‎MultiCommentViewer/Properties/AssemblyInfo.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
[assembly: InternalsVisibleTo("MultiCommentViewerTests")]
55

6-
[assembly: AssemblyVersion("0.6.32")]
6+
[assembly: AssemblyVersion("0.6.33")]

‎NicoSitePlugin2/Api.cs‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,6 @@ class UserInfo
2424
}
2525
static class Api
2626
{
27-
public static async Task<UserInfo> GetUserInfo(IDataSource server, CookieContainer cc, string userId)
28-
{
29-
var url = $"https://public.api.nicovideo.jp/v1/users.json?userIds={userId}";
30-
var res = await server.GetAsync(url, cc);
31-
var obj = JsonConvert.DeserializeObject<NicoSitePlugin2.Low.UserInfo.RootObject>(res);
32-
if (obj.Data.Length == 0)
33-
{
34-
throw new ArgumentException("指定されたuserIdは存在しない:" + userId);
35-
}
36-
var data = obj.Data[0];
37-
var userInfo = new UserInfo
38-
{
39-
Nickname = data.Nickname,
40-
UserIconUrl = data.Icons.Urls.The150X150,
41-
};
42-
return userInfo;
43-
}
4427
public static async Task<CommunityLiveInfo[]> GetCommunityLives(IDataSource server, CookieContainer cc, string communityId)
4528
{
4629
//以下のAPIだとON_AIRだけ取れる。

‎NicoSitePlugin2/TestCommentProvider.cs‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public override async Task ConnectAsync(string input, IBrowserProfile browserPro
4242
return;
4343
}
4444
_isFirstConnection = true;
45-
reload:
45+
reload:
4646
_isDisconnectedExpected = false;
4747
_disconnectCts = new CancellationTokenSource();
4848
try
@@ -83,7 +83,7 @@ private CookieContainer GetCookieContainer(IBrowserProfile browserProfile)
8383
}
8484
private async Task<string> GetChannelLiveId(ChannelUrl channelUrl)
8585
{
86-
check:
86+
check:
8787
var currentLiveId = await Api.GetCurrentChannelLiveId(_server, channelUrl.ChannelScreenName);
8888
if (currentLiveId != null)
8989
{
@@ -101,7 +101,7 @@ private async Task<string> GetChannelLiveId(ChannelUrl channelUrl)
101101
}
102102
private async Task<string> GetCommunityLiveId(CommunityUrl communityUrl, CookieContainer cc)
103103
{
104-
check:
104+
check:
105105
var currentLiveId = await Api.GetCurrentCommunityLiveId(_server, communityUrl.CommunityId, cc);
106106
if (currentLiveId != null)
107107
{
@@ -135,7 +135,7 @@ public async Task ConnectInternalAsync(IInput input, IBrowserProfile browserProf
135135
{
136136
vid = await GetCommunityLiveId(communityUrl, cc);
137137
}
138-
else if(input is LiveId liveId)
138+
else if(input is LiveId liveId)
139139
{
140140
vid = liveId.Raw;
141141
}
@@ -417,17 +417,6 @@ private async Task ProcessChatMessageAsync(Chat.IChatMessage message)
417417
{
418418
_chatProvider?.Disconnect();
419419
}
420-
string username;
421-
if (IsRawUserId(chat.UserId) && chat.UserId != SystemUserId && _siteOptions.IsAutoGetUsername)
422-
{
423-
var userInfo = await Api.GetUserInfo(_server, _cc, chat.UserId);
424-
username = userInfo.Nickname;
425-
user.Name = Common.MessagePartFactory.CreateMessageItems(username);
426-
}
427-
else
428-
{
429-
username = null;
430-
}
431420
if (_siteOptions.IsAutoSetNickname)
432421
{
433422
var nick = SitePluginCommon.Utils.ExtractNickname(chat.Content);
@@ -444,7 +433,7 @@ private async Task ProcessChatMessageAsync(Chat.IChatMessage message)
444433
PostedAt = Common.UnixTimeConverter.FromUnixTime(chat.Date),
445434
Text = chat.Content,
446435
UserId = chat.UserId,
447-
UserName = username,
436+
UserName = null,
448437
};
449438
comment = abc;
450439
metadata = new CommentMessageMetadata(abc, _options, _siteOptions, user, this, isFirstComment)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /