private async Task RetweetAsyncInternal(IProgress<string> p, CancellationToken ct, IReadOnlyList<long> statusIds)
{
if (ct.IsCancellationRequested)
return;
if (!CheckAccountValid())
throw new WebApiException("Auth error. Check your account");
bool read;
if (!this._cfgCommon.UnreadManage)
read = true;
else
read = this._initial && this._cfgCommon.Read;
p.Report("Posting...");
foreach (var statusId in statusIds)
{
await this.tw.PostRetweet(statusId, read).ConfigureAwait(false);
}
if (ct.IsCancellationRequested)
return;
p.Report(Properties.Resources.PostWorker_RunWorkerCompletedText4);
this._postTimestamps.Add(DateTime.Now);
var oneHour = DateTime.Now - TimeSpan.FromHours(1);
foreach (var i in MyCommon.CountDown(this._postTimestamps.Count - 1, 0))
{
if (this._postTimestamps[i] < oneHour)
this._postTimestamps.RemoveAt(i);
}
}