this.Api.Initialize(token, tokenSecret, userId, username);
}
- public void Initialize(TwitterAppToken appToken, string token, string tokenSecret, string username, long userId)
+ public void Initialize(ITwitterCredential credential, string username, long userId)
{
// OAuth認証
- if (MyCommon.IsNullOrEmpty(token) || MyCommon.IsNullOrEmpty(tokenSecret) || MyCommon.IsNullOrEmpty(username))
- {
+ if (credential is TwitterCredentialNone)
Twitter.AccountState = MyCommon.ACCOUNT_STATE.Invalid;
- }
+
this.ResetApiStatus();
- this.Api.Initialize(appToken, token, tokenSecret, userId, username);
+ this.Api.Initialize(credential, userId, username);
}
public async Task<PostClass?> PostStatus(PostStatusParams param)
var request = new UserTweetsAndRepliesRequest(userId)
{
Count = count,
- Cursor = more ? tab.CursorBottom : null,
+ Cursor = more ? tab.CursorBottom : tab.CursorTop,
};
var response = await request.Send(this.Api.Connection)
.ConfigureAwait(false);
.ToArray();
tab.CursorBottom = response.CursorBottom;
+
+ if (!more)
+ tab.CursorTop = response.CursorTop;
}
else
{
var request = new ListLatestTweetsTimelineRequest(tab.ListInfo.Id.ToString())
{
Count = count,
- Cursor = more ? tab.CursorBottom : null,
+ Cursor = more ? tab.CursorBottom : tab.CursorTop,
};
var response = await request.Send(this.Api.Connection)
.ConfigureAwait(false);
statuses = convertedStatuses.ToArray();
tab.CursorBottom = response.CursorBottom;
+
+ if (!more)
+ tab.CursorTop = response.CursorTop;
}
else if (more)
{
var request = new SearchTimelineRequest(tab.SearchWords)
{
Count = count,
- Cursor = more ? tab.CursorBottom : null,
+ Cursor = more ? tab.CursorBottom : tab.CursorTop,
};
var response = await request.Send(this.Api.Connection)
.ConfigureAwait(false);
.ToArray();
tab.CursorBottom = response.CursorBottom;
+
+ if (!more)
+ tab.CursorTop = response.CursorTop;
}
else
{
public string[] GetHashList()
=> this.postFactory.GetReceivedHashtags();
- public string AccessToken
- => ((TwitterApiConnection)this.Api.Connection).AccessToken;
-
- public string AccessTokenSecret
- => ((TwitterApiConnection)this.Api.Connection).AccessSecret;
-
private void CheckAccountState()
{
if (Twitter.AccountState != MyCommon.ACCOUNT_STATE.Valid)