Esempio n. 1
0
        public void Remove(Guid listId, Guid accountId)
        {
            try
            {
                HashSetBlob <Guid> bAddRmvMsgs = blobFactory.LAddRmvMsgs(listId);
                if (!bAddRmvMsgs.AddIfNotInWithRetry(accountId, new ListNotFound()))
                {
                    return;
                }

                if (!blobFactory.LFollowedByPublic(accountId).RemoveWithRetry(listId))
                {
                    bAddRmvMsgs.RemoveWithRetry(accountId);
                    throw new AccountNotFound();
                }

                blobFactory.LFollowedByAll(accountId).RemoveWithRetry(listId);
                blobFactory.LFollowedAccounts(listId).RemoveWithRetry(accountId);

                blobFactory.MListMessages(listId).ExceptWith(blobFactory.MListMessages(blobFactory.LPersonnalList(accountId).Get()));

                bAddRmvMsgs.RemoveWithRetry(accountId);
            }
            catch { }
        }
Esempio n. 2
0
        public void Add(Guid listId, Guid accountId)
        {
            // Set WIP to true
            HashSetBlob <Guid> bAddRmvMsgs = blobFactory.LAddRmvMsgs(listId);

            if (!bAddRmvMsgs.AddIfNotInWithRetry(accountId, new ListNotFound()))
            {
                return;
            }

            // Add list and accounts to the sets
            if (!blobFactory.LFollowedByAll(accountId).AddWithRetry(listId))
            {
                bAddRmvMsgs.RemoveWithRetry(accountId);
                throw new AccountNotFound();
            }

            blobFactory.LFollowedAccounts(listId).AddWithRetry(accountId);

            if (!blobFactory.LInfo(listId).Get().IsPrivate)
            {
                blobFactory.LFollowedByPublic(accountId).AddWithRetry(listId);
            }

            // add msgs
            Guid PersonnalListId = blobFactory.LPersonnalList(accountId).Get();

            blobFactory.MListMessages(listId).UnionWith(blobFactory.MListMessages(PersonnalListId));

            // set WIP to false
            bAddRmvMsgs.RemoveWithRetry(accountId);
        }