protected override bool FilterStatus(TwitterStatusBase status) { var ts = status as TwitterStatus; if (ts == null) return false; if (ts.User.ScreenName == User1) { if (ts.InReplyToScreenName == User2 || TweetModel.GetExtraData(ts.Id).InReplyFromUserScreenNameContains(User2) || ts.Text.Contains("@" + User2)) return true; else return false; } else if (ts.User.ScreenName == User2) { if (ts.InReplyToScreenName == User1 || TweetModel.GetExtraData(ts.Id).InReplyFromUserScreenNameContains(User1) || ts.Text.Contains("@" + User1)) return true; else return false; } else return false; }
protected override bool FilterStatus(TwitterStatusBase status) { var ts = status as TwitterDirectMessage; if (ts == null) return false; return (ts.Sender.ScreenName == User1 && ts.Recipient.ScreenName == User2) || (ts.Sender.ScreenName == User2 && ts.Recipient.ScreenName == User1); }
public LocalNGViewModel(TabData tabData, TwitterStatusBase status) { this._tabdata = tabData; this._status = status; this._selectedText = String.Empty; RejectModeIndex = 0; }
public static bool IsInReplyToMeCurrent(TwitterStatusBase status) { if (IsInReplyToMeCurrentStrict(status)) return true; var ctab = CommonEventServer.CurrentTabData; if (ctab == null) return false; return ctab.LinkAccounts.Any((a) => Regex.IsMatch(status.Text, "@" + a + "(?![a-zA-Z0-9_])", RegexOptions.Singleline | RegexOptions.IgnoreCase)); }
internal static TwitterUser SuggestedUser(TwitterStatusBase status) { if (status == null) return null; if (Analyzer.PublishedByRetweet(status as TwitterStatus)) return ((TwitterStatus)status).RetweetedOriginal.User; else return status.User; }
private bool CheckFilter(TwitterStatusBase status) { try { return Filter != null ? Filter.Filter(status) : true; } catch (Exception e) { InformServer.Report("フィルタの適用時にエラーが発生しました: " + e.Message, InformServer.NotifyLevel.Error); return false; } }
/// <summary> /// このフィルタクラスタに所属するフィルタについて、フィルタ条件に合致するかの判定を行います。<para /> /// Negateは内部で考慮されます。<para /> /// フィルタが一つもない場合は、U=∅のときの∀(AND)、∃(OR)のBoolean値に準じます。<para /> /// (ANDのとき:TRUE ORのとき:FALSE) /// </summary> /// <param name="status">フィルタテストするステータス</param> /// <returns>ステータスがフィルタに合致するか</returns> public bool Filter(TwitterStatusBase status) { if (_filters != null) { foreach (var f in _filters) { // ANDのとき => FALSEに出会ったらFALSEを返す // ORのとき => TRUEに出会ったらTRUEを返す if (f.Filter(status) == ConcatenateOR) return ConcatenateOR == !Negate; } } // ANDのとき => FALSEに出会っていないのでTRUEを返す // ORのとき => TRUEに出会っていないのでFALSEを返す return !ConcatenateOR == !Negate; }
public static bool IsInReplyToMeStrict(TwitterStatusBase status) { var s = status as TwitterStatus; if (s != null) { return AccountModel.GetAccountElements().Any((d) => d.CredentialInfo.UserScreenName == s.InReplyToScreenName); } else { var dm = status as TwitterDirectMessage; if (dm != null) { return AccountModel.GetAccountElements().Any((d) => d.CredentialInfo.UserScreenName == dm.Recipient.ScreenName); } else { return false; } } }
/// <summary> /// フィルタを適用します。 /// </summary> /// <returns>フィルタを通過したか</returns> public bool Filter(TwitterStatusBase status) { return FilterStatus(status) == !Negate; }
internal static void RaiseSelectedStatusChanged(TwitterStatusBase selected) { dispatcher.BeginInvoke(() => { CurrentSelectedStatus = selected; CurrentSelectedStatusChanged(selected); }); }
public UserSelectInteraction(InteractionKind kind, TwitterStatusBase status, Action<IEnumerable<AccountElement>> callback) { this.Kind = kind; this.Status = status; this.Callback = callback; }
internal static void RaiseSelectedStatusChanged(TwitterStatusBase selected) { CurrentSelectedStatus = selected; CurrentSelectedStatusChanged(selected); }
public InputInteractionDescriptor(TwitterStatusBase inReplyTo, bool setFocus = true) : this(null, inReplyTo, CursorPoint.End , setFocus) { }
public InputInteractionDescriptor(string text, TwitterStatusBase inReplyTo = null, CursorPoint cp = CursorPoint.Begin, bool setFocus = true) { this.Text = text; this.InReplyTo = inReplyTo; this.NewCursorPoint = cp; this.SetFocus = setFocus; }
public static bool IsInReplyToMeCurrentStrict(TwitterStatusBase status) { var ctab = CommonEventServer.CurrentTabData; if (ctab == null) return false; var s = status as TwitterStatus; if (s != null) { return ctab.LinkAccounts.Any((a) => a == s.InReplyToScreenName); } else { var dm = status as TwitterDirectMessage; if (dm != null) { return ctab.LinkAccounts.Any((a) => a == dm.Recipient.ScreenName); } else { return false; } } }
protected abstract bool FilterStatus(TwitterStatusBase status);
void TweetServerModel_ReceivedStatus(TwitterStatusBase obj) { if (CheckFilter(obj)) { try { rwLock.EnterWriteLock(); internalStorage.Add(obj); } finally { rwLock.ExitWriteLock(); } AddTweet(obj); } }
public static bool IsInReplyToMe(TwitterStatusBase status) { if (IsInReplyToMeStrict(status)) return true; return AccountModel.GetAccountElements().Any((d) => Regex.IsMatch(status.Text, "@" + d.CredentialInfo.UserScreenName + "(?![a-zA-Z0-9_])", RegexOptions.Singleline | RegexOptions.IgnoreCase)); }