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);
        }
Beispiel #2
0
 internal static void NotifyBlocked(TwitterUser source, TwitterUser target)
 {
     if (MuteBlockManager.IsBlocked(source))
     {
         return;
     }
     if (!NotificationLatch.CheckSetPositive(
             NotificationLatchTarget.Block, source.Id, target.Id))
     {
         return;
     }
     Head.NotifyBlocked(source, target);
 }
Beispiel #3
0
 internal static void NotifyFavorited(TwitterUser source, TwitterStatus status)
 {
     if (MuteBlockManager.IsBlocked(source))
     {
         return;
     }
     if (!NotificationLatch.CheckSetPositive(
             NotificationLatchTarget.Favorite, source.Id, status.Id))
     {
         return;
     }
     Task.Run(() => UserProxy.StoreUser(source));
     Task.Run(() => StatusModel.UpdateStatusInfo(
                  status.Id,
                  model => model.AddFavoritedUser(source), _ =>
     {
         StatusProxy.AddFavoritor(status.Id, source.Id);
         StatusBroadcaster.Republish(status);
     }));
     Head.NotifyFavorited(source, status);
 }