Ejemplo n.º 1
0
 public static void Initialize()
 {
     // register binder
     BridgeSocketBinder.Bind(NotificationProxy.Socket,
                             p => RegisterProxy(new NotificationProxyWrapper(p)));
     NotificationLatch.Initialize();
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 internal static void NotifyUnblocked(TwitterUser source, TwitterUser target)
 {
     if (MuteBlockManager.IsBlocked(source))
     {
         return;
     }
     if (!NotificationLatch.CheckSetNegative(
             NotificationLatchTarget.Block, source.Id, target.Id))
     {
         return;
     }
     Head.NotifyUnblocked(source, target);
 }
Ejemplo n.º 4
0
 internal static void NotifyMuted(TwitterUser source, TwitterUser target)
 {
     if (MuteBlockManager.IsBlocked(source) || MuteBlockManager.IsOfficialMuted(source))
     {
         return;
     }
     if (!NotificationLatch.CheckSetPositive(
             NotificationLatchTarget.Mute, source.Id, target.Id))
     {
         return;
     }
     Head.NotifyMuted(source, target);
 }
Ejemplo n.º 5
0
 internal static void NotifyUnfavorited(TwitterUser source, TwitterStatus status)
 {
     if (MuteBlockManager.IsBlocked(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);
 }