FavorareMenuItem.Enabled = true;
ShowRelatedStatusesMenuItem.Enabled = true; //PublicSearchの時問題出るかも
- if (_curPost.IsProtect)
+ if (!_curPost.CanRetweetBy(this.twitterApi.CurrentUserId))
{
ReTweetStripMenuItem.Enabled = false;
ReTweetUnofficialStripMenuItem.Enabled = false;
return;
TabModel foundTab = null;
+ int foundIndex = 0;
+
DetailsListView lst = null;
//現在タブから最終タブまで探索
{
var tabPage = this.ListTab.TabPages[i];
var tab = this._statuses.Tabs[tabPage.Text];
+ var unreadIndex = tab.NextUnreadIndex;
- if (tab.NextUnreadIndex != -1)
+ if (unreadIndex != -1)
{
ListTab.SelectedIndex = i;
foundTab = tab;
+ foundIndex = unreadIndex;
lst = (DetailsListView)tabPage.Tag;
break;
}
{
var tabPage = this.ListTab.TabPages[i];
var tab = this._statuses.Tabs[tabPage.Text];
+ var unreadIndex = tab.NextUnreadIndex;
- if (tab.NextUnreadIndex != -1)
+ if (unreadIndex != -1)
{
ListTab.SelectedIndex = i;
foundTab = tab;
+ foundIndex = unreadIndex;
lst = (DetailsListView)tabPage.Tag;
break;
}
}
}
- int idx;
- if (foundTab != null)
- {
- idx = foundTab.NextUnreadIndex;
- }
- else
+ if (foundTab == null)
{
//全部調べたが未読見つからず→先頭タブの最新発言へ
ListTab.SelectedIndex = 0;
return;
if (_statuses.SortOrder == SortOrder.Ascending)
- idx = tab.AllCount - 1;
+ foundIndex = tab.AllCount - 1;
else
- idx = 0;
+ foundIndex = 0;
lst = (DetailsListView)tabPage.Tag;
}
- SelectListItem(lst, idx);
+ SelectListItem(lst, foundIndex);
if (_statuses.SortMode == ComparerMode.Id)
{
- if (_statuses.SortOrder == SortOrder.Ascending && lst.Items[idx].Position.Y > lst.ClientSize.Height - _iconSz - 10 ||
- _statuses.SortOrder == SortOrder.Descending && lst.Items[idx].Position.Y < _iconSz + 10)
+ if (_statuses.SortOrder == SortOrder.Ascending && lst.Items[foundIndex].Position.Y > lst.ClientSize.Height - _iconSz - 10 ||
+ _statuses.SortOrder == SortOrder.Descending && lst.Items[foundIndex].Position.Y < _iconSz + 10)
{
MoveTop();
}
else
{
- lst.EnsureVisible(idx);
+ lst.EnsureVisible(foundIndex);
}
}
else
{
- lst.EnsureVisible(idx);
+ lst.EnsureVisible(foundIndex);
}
lst.Focus();
private void CopyIdUri()
{
- string clstr = "";
- StringBuilder sb = new StringBuilder();
- if (this._curTab == null) return;
- if (this._statuses.GetTabByName(this._curTab.Text) == null) return;
- if (this._statuses.GetTabByName(this._curTab.Text).TabType == MyCommon.TabUsageType.DirectMessage) return;
+ if (this._curTab == null)
+ return;
+
+ var tab = this._statuses.GetTabByName(this._curTab.Text);
+ if (tab == null || tab is DirectMessagesTabModel)
+ return;
+
+ var copyUrls = new List<string>();
foreach (int idx in _curList.SelectedIndices)
{
- var post = _statuses.Tabs[_curTab.Text][idx];
- sb.Append(MyCommon.GetStatusUrl(post));
- sb.Append(Environment.NewLine);
+ var post = tab[idx];
+ copyUrls.Add(MyCommon.GetStatusUrl(post));
}
- if (sb.Length > 0)
+
+ if (copyUrls.Count == 0)
+ return;
+
+ try
{
- clstr = sb.ToString();
- try
- {
- Clipboard.SetDataObject(clstr, false, 5, 100);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
+ Clipboard.SetDataObject(string.Join(Environment.NewLine, copyUrls), false, 5, 100);
+ }
+ catch (ExternalException ex)
+ {
+ MessageBox.Show(ex.Message);
}
}
//公式RT
if (this.ExistCurrentPost)
{
- if (_curPost.IsProtect)
+ if (!_curPost.CanRetweetBy(this.twitterApi.CurrentUserId))
{
- MessageBox.Show("Protected.");
+ if (this._curPost.IsProtect)
+ MessageBox.Show("Protected.");
+
_DoFavRetweetFlags = false;
return;
}
}
else
{
- if (_curPost.IsDm)
- {
- _DoFavRetweetFlags = false;
- return;
- }
if (!this._cfgCommon.RetweetNoConfirm)
{
string Questiontext = Properties.Resources.RetweetQuestion1;
foreach (int idx in _curList.SelectedIndices)
{
PostClass post = GetCurTabPost(idx);
- if (!post.IsProtect && !post.IsDm)
+ if (post.CanRetweetBy(this.twitterApi.CurrentUserId))
statusIds.Add(post.StatusId);
}
this.OpenFavotterOpMenuItem.Enabled = true;
this.ShowRelatedStatusesMenuItem2.Enabled = true; //PublicSearchの時問題出るかも
- if (_curPost.IsProtect)
+ if (!_curPost.CanRetweetBy(this.twitterApi.CurrentUserId))
{
this.RtOpMenuItem.Enabled = false;
this.RtUnOpMenuItem.Enabled = false;
ModifySettingCommon = true;
SaveConfigsAll(true);
- if (ImageSelector.ServiceName.Equals("Twitter"))
- this.StatusText_TextChanged(null, null);
+ this.StatusText_TextChanged(null, null);
}
}