public static void Initialize() { // register binder BridgeSocketBinder.Bind(NotificationProxy.Socket, p => RegisterProxy(new NotificationProxyWrapper(p))); NotificationLatch.Initialize(); }
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 NotifyUnblocked(TwitterUser source, TwitterUser target) { if (MuteBlockManager.IsBlocked(source)) { return; } if (!NotificationLatch.CheckSetNegative( NotificationLatchTarget.Block, source.Id, target.Id)) { return; } Head.NotifyUnblocked(source, target); }
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); }
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); }