InReplyToUser = "hogehoge",
InReplyToUserId = 100L,
IsReply = true,
- ReplyToList = new List<string> {"hogehoge"},
+ ReplyToList = new List<Tuple<long, string>> { Tuple.Create(100L, "hogehoge") },
};
post.IsDeleted = true;
private long? _InReplyToStatusId;
public string Source { get; set; }
public Uri SourceUri { get; set; }
- public List<string> ReplyToList { get; set; }
+ public List<Tuple<long, string>> ReplyToList { get; set; }
public bool IsMe { get; set; }
public bool IsDm { get; set; }
public long UserId { get; set; }
{
RetweetedBy = "";
Media = new List<MediaInfo>();
- ReplyToList = new List<string>();
+ ReplyToList = new List<Tuple<long, string>>();
QuoteStatusIds = new long[0];
ExpandedUrls = new ExpandedUrlInfo[0];
}
this.InReplyToUser = "";
this.InReplyToUserId = null;
this.IsReply = false;
- this.ReplyToList = new List<string>();
+ this.ReplyToList = new List<Tuple<long, string>>();
this._states = States.None;
}
_IsDeleted = value;
public PostClass Clone()
{
var clone = (PostClass)this.MemberwiseClone();
- clone.ReplyToList = new List<string>(this.ReplyToList);
+ clone.ReplyToList = new List<Tuple<long, string>>(this.ReplyToList);
clone.Media = new List<MediaInfo>(this.Media);
clone.QuoteStatusIds = this.QuoteStatusIds.ToArray();
clone.ExpandedUrls = this.ExpandedUrls.Select(x => x.Clone()).ToArray();
else if (TargetPost.IsReply)
//自分宛返信
cl = _clAtSelf;
- else if (BasePost.ReplyToList.Contains(TargetPost.ScreenName.ToLowerInvariant()))
+ else if (BasePost.ReplyToList.Any(x => x.Item1 == TargetPost.UserId))
//返信先
cl = _clAtFromTarget;
- else if (TargetPost.ReplyToList.Contains(BasePost.ScreenName.ToLowerInvariant()))
+ else if (TargetPost.ReplyToList.Any(x => x.Item1 == BasePost.UserId))
//その人への返信
cl = _clAtTarget;
else if (TargetPost.ScreenName.Equals(BasePost.ScreenName, StringComparison.OrdinalIgnoreCase))
post.RetweetedBy == _anchorPost.ScreenName ||
post.ScreenName == _anchorPost.RetweetedBy ||
(!string.IsNullOrEmpty(post.RetweetedBy) && post.RetweetedBy == _anchorPost.RetweetedBy) ||
- _anchorPost.ReplyToList.Contains(post.ScreenName.ToLowerInvariant()) ||
- _anchorPost.ReplyToList.Contains(post.RetweetedBy.ToLowerInvariant()) ||
- post.ReplyToList.Contains(_anchorPost.ScreenName.ToLowerInvariant()) ||
- post.ReplyToList.Contains(_anchorPost.RetweetedBy.ToLowerInvariant()))
+ _anchorPost.ReplyToList.Any(x => x.Item1 == post.UserId) ||
+ _anchorPost.ReplyToList.Any(x => x.Item1 == post.RetweetedByUserId) ||
+ post.ReplyToList.Any(x => x.Item1 == _anchorPost.UserId) ||
+ post.ReplyToList.Any(x => x.Item1 == _anchorPost.RetweetedByUserId))
{
SelectListItem(_curList, idx);
_curList.EnsureVisible(idx);
}
if (isAll)
{
- foreach (string nm in post.ReplyToList)
+ foreach (string nm in post.ReplyToList.Select(x => x.Item2))
{
if (!ids.Contains("@" + nm + " ") &&
!nm.Equals(tw.Username, StringComparison.CurrentCultureIgnoreCase))
{
ids += "@" + post.ScreenName + " ";
}
- foreach (string nm in post.ReplyToList)
+ foreach (string nm in post.ReplyToList.Select(x => x.Item2))
{
if (!ids.Contains("@" + nm + " ") &&
!nm.Equals(tw.Username, StringComparison.CurrentCultureIgnoreCase))
sb.AppendFormat("IsRead : {0}<br>", post.IsRead);
sb.AppendFormat("IsReply : {0}<br>", post.IsReply);
- foreach (string nm in post.ReplyToList)
+ foreach (string nm in post.ReplyToList.Select(x => x.Item2))
{
sb.AppendFormat("ReplyToList : {0}<br>", nm);
}
post.Source = string.Intern(sourceText);
post.SourceUri = sourceUri;
- post.IsReply = post.RetweetedId == null && post.ReplyToList.Contains(_uname);
+ post.IsReply = post.RetweetedId == null && post.ReplyToList.Any(x => x.Item1 == this.UserId);
post.IsExcludeReply = false;
if (post.IsMe)
}
}
- public string CreateHtmlAnchor(string text, List<string> AtList, TwitterEntities entities, List<MediaInfo> media)
+ public string CreateHtmlAnchor(string text, List<Tuple<long, string>> AtList, TwitterEntities entities, List<MediaInfo> media)
{
if (entities != null)
{
{
foreach (var ent in entities.UserMentions)
{
- var screenName = ent.ScreenName.ToLowerInvariant();
- if (!AtList.Contains(screenName))
- AtList.Add(screenName);
+ AtList.Add(Tuple.Create(ent.Id, ent.ScreenName));
}
}
if (entities.Media != null)