public TwitterStatusExtended(Status twitterStatus, TweetListType TweetType, Decimal TwitterAccountID, Decimal CurrentTweetID)
 {
     this.TwitterAccountID = TwitterAccountID;
       this.DirectMessageEnabled = true;
       this.ReplyEnabled = true;
       this.RetweetEnabled = true;
       this.DeleteTweetEnabled = false;
       if (twitterStatus == null)
     return;
       this.UnRead = twitterStatus.Id > CurrentTweetID;
       this.TweetType = TweetType;
       App.AppState.Accounts[this.TwitterAccountID].Cache.AddIntellisenseUser(twitterStatus.User.ScreenName, twitterStatus.User.ProfileImageSecureLocation);
       DateTime createdDate = twitterStatus.CreatedDate;
       bool flag = 1 == 0;
       this.CreatedDate = twitterStatus.CreatedDate;
       this.IsFavourited = twitterStatus.IsFavorited;
       this.DeleteTweetEnabled = twitterStatus.User.ScreenName.ToLower() == App.AppState.Accounts[this.TwitterAccountID].TwitterAccountName.ToLower();
       this.IsSelfTweet = this.DeleteTweetEnabled;
       this.CanUndoTweet = this.IsSelfTweet && this.CreatedDate >= DateTime.Now.AddMinutes(-30.0) && twitterStatus.RetweetedStatus == null;
       if (twitterStatus.RetweetedStatus == null)
       {
     this.IsRetweet = false;
     this.RetweetVisibility = Visibility.Collapsed;
     this.YourRetweetVisibility = Visibility.Collapsed;
     this.RetweetUser = (MetroTwitUser) null;
     this.RetweetPiP = false;
     this.ID = twitterStatus.Id;
     this.RetweetEnabled = !twitterStatus.User.IsProtected;
       }
       else
       {
     this.IsRetweet = true;
     this.RetweetVisibility = Visibility.Visible;
     this.RetweetUser = new MetroTwitUser(twitterStatus.User);
     this.YourRetweetVisibility = this.RetweetUser.ScreenName.ToLower() == App.AppState.Accounts[this.TwitterAccountID].TwitterAccountName.ToLower() ? Visibility.Visible : Visibility.Collapsed;
     this.RetweetPiP = true;
     this.RetweetEnabled = !twitterStatus.RetweetedStatus.User.IsProtected;
     this.ID = twitterStatus.Id;
     this.OriginalID = twitterStatus.RetweetedStatus.Id;
     twitterStatus = twitterStatus.RetweetedStatus;
     this.RetweetText = this.RetweetUser.Name;
       }
       if (twitterStatus.RetweetCount >= 1)
       {
     this.RetweetVisibility = Visibility.Collapsed;
     this.RetweetCountVisibility = Visibility.Visible;
     string str = twitterStatus.RetweetCount > 1 ? " people" : " person";
     if (this.RetweetUser != null)
     {
       if (twitterStatus.RetweetCount > 1)
     this.RetweetText = string.Concat(new object[4]
     {
       (object) this.RetweetText,
       (object) " & ",
       (object) twitterStatus.RetweetCount,
       (object) str
     });
     }
     else
       this.RetweetText = twitterStatus.RetweetCount + str;
     if (this.OriginalID == new Decimal(0))
       this.OriginalID = this.ID;
       }
       else
     this.RetweetCountVisibility = Visibility.Collapsed;
       this.RawText = twitterStatus.Text;
       this.User = new MetroTwitUser(twitterStatus.User);
       this.BlockEnabled = this.User.ScreenName.ToLower() != App.AppState.Accounts[this.TwitterAccountID].TwitterAccountName.ToLower();
       this.SpamEnabled = this.BlockEnabled;
       if (twitterStatus.Source != null)
     this.Source = WebUtility.HtmlDecode(twitterStatus.Source);
       this.InReplyToScreenName = twitterStatus.InReplyToScreenName;
       this.InReplyTo = twitterStatus.InReplyToStatusId;
       this.Geo = twitterStatus.Place;
       this.Coordinates = twitterStatus.Coordinates;
       this.GeoVisibility = this.Geo != null ? Visibility.Visible : Visibility.Collapsed;
       this.ReplyToVisibility = !(this.InReplyTo > new Decimal(0)) || TweetType == TweetListType.Conversation ? Visibility.Collapsed : Visibility.Visible;
       this.FavouriteVisible = Visibility.Visible;
       App.AppState.Accounts[this.TwitterAccountID].Cache.AddIntellisenseUser(twitterStatus.User.ScreenName, twitterStatus.User.ProfileImageSecureLocation);
       if (twitterStatus.Entities == null)
       {
     this.Entities = RegularExpressions.ExtractEntities(this.RawText);
       }
       else
       {
     App.AppState.Accounts[this.TwitterAccountID].Cache.AddIntellisenseHashTags(Enumerable.Select<HashTagEntity, string>(Enumerable.OfType<HashTagEntity>((IEnumerable) twitterStatus.Entities), (Func<HashTagEntity, string>) (hashTag => "#" + hashTag.Text)));
     this.Entities = twitterStatus.Entities;
       }
       switch (TweetType)
       {
     case TweetListType.MentionsMyTweetsRetweeted:
       this.DefaultGridVisible = Visibility.Collapsed;
       this.ReplyGridVisible = Visibility.Visible;
       break;
     case TweetListType.MyTweets:
       this.ReplyEnabled = false;
       this.RetweetEnabled = false;
       break;
       }
       foreach (UrlEntity u in Enumerable.ToArray<UrlEntity>(Enumerable.OfType<UrlEntity>((IEnumerable) this.Entities)))
       {
     MediaEntity media = MediaManager.CheckEntityandCreateMedia(u);
     if (media != null)
     {
       this.Entities.Remove((Entity) u);
       this.Entities.Add((Entity) media);
     }
       }
       this.Media = Enumerable.OfType<MediaEntity>((IEnumerable) this.Entities);
       this.ContainsMedia = Enumerable.Count<MediaEntity>(this.Media) > 0;
       if (this.ContainsMedia)
     this.MediaThumbnail = Enumerable.FirstOrDefault<MediaEntity>(this.Media);
 }
예제 #2
0
 internal void StatusReceived(Status status)
 {
     this.ResetStopped();
       Messenger.Default.Send<GenericMessage<object>>(new GenericMessage<object>((object) status), (object) this.MultiAccountifyToken((Enum) ViewModelMessages.StreamingStatusReceived));
 }