internal static void NotifyRetweetRetweeted(TwitterUser source, TwitterUser target, TwitterStatus status) { if (MuteBlockManager.IsBlocked(source) || MuteBlockManager.IsOfficialMuted(source)) { return; } if (!Setting.NotifyBackfilledTweets.Value && status.CreatedAt < App.StartupDateTime) { // backfilled tweets return; } var original = status.RetweetedStatus; if (original == null) { return; } Task.Run(() => UserProxy.StoreUser(source)); Task.Run(() => StatusModel.UpdateStatusInfo( original.Id, model => model.AddRetweetedUser(source), _ => { StatusProxy.AddRetweeter(original.Id, source.Id); StatusBroadcaster.Republish(original); })); Head.NotifyRetweetRetweeted(source, target, status); }
internal static void NotifyRetweetFavorited(TwitterUser source, TwitterUser target, TwitterStatus status) { if (MuteBlockManager.IsBlocked(source) || MuteBlockManager.IsOfficialMuted(source)) { return; } if (!NotificationLatch.CheckSetPositive(NotificationLatchTarget.Favorite, source.Id, status.Id)) { return; } var original = status.RetweetedStatus; if (original == null) { return; } Task.Run(() => UserProxy.StoreUser(source)); Task.Run(() => StatusModel.UpdateStatusInfo( original.Id, model => model.AddFavoritedUser(source), _ => { StatusProxy.AddFavoritor(original.Id, source.Id); StatusBroadcaster.Republish(original); })); Head.NotifyRetweetFavorited(source, target, status); }
internal static void NotifyUserUpdated(TwitterUser source) { if (MuteBlockManager.IsBlocked(source) || MuteBlockManager.IsOfficialMuted(source)) { return; } Head.NotifyUserUpdated(source); }
internal static void NotifyUnmuted(TwitterUser source, TwitterUser target) { if (MuteBlockManager.IsBlocked(source) || MuteBlockManager.IsOfficialMuted(source)) { return; } if (!NotificationLatch.CheckSetNegative( NotificationLatchTarget.Mute, source.Id, target.Id)) { return; } Head.NotifyUnmuted(source, target); }
internal static void NotifyQuoted(TwitterUser source, TwitterStatus original, TwitterStatus quote) { if (MuteBlockManager.IsBlocked(source) || MuteBlockManager.IsOfficialMuted(source)) { return; } if (!Setting.NotifyBackfilledTweets.Value && quote.CreatedAt < App.StartupDateTime) { // backfilled tweets return; } Task.Run(() => UserProxy.StoreUser(source)); Head.NotifyQuoted(source, original, quote); }
internal static void NotifyUnfavorited(TwitterUser source, TwitterStatus status) { if (MuteBlockManager.IsBlocked(source) || MuteBlockManager.IsOfficialMuted(source)) { return; } if (!NotificationLatch.CheckSetNegative( NotificationLatchTarget.Favorite, source.Id, status.Id)) { return; } Task.Run(() => StatusModel.UpdateStatusInfo( status.Id, model => model.RemoveFavoritedUser(source.Id), _ => { StatusProxy.RemoveFavoritor(status.Id, source.Id); StatusBroadcaster.Republish(status); })); Head.NotifyUnfavorited(source, status); }