internal Guid CreateList(Guid ownerId, string name, string description, bool isPrivate, bool isPersonal) { Guid id = Guid.NewGuid(); AccountStorageTmp.FullAccountInfo accountInfo = this.motherStorage.account.GetFullInfo(ownerId); var listInfo = new FullListInfo { Id = id, Followers = new HashSet <Guid> { ownerId }, ListInfo = new ListInfo(name, description, isPrivate, isPersonal), Members = new HashSet <Guid> { ownerId }, Messages = new List <IMessage>(), OwnerId = ownerId }; accountInfo.MemberOfLists.Add(id); accountInfo.FollowerOfLists.Add(id); this.infoFromId.Add(id, listInfo); return(id); }
public void Add(Guid listId, Guid accountId) { FullListInfo listInfo = this.GetFullInfo(listId); AccountStorageTmp.FullAccountInfo accountInfo = this.motherStorage.account.GetFullInfo(accountId); listInfo.Members.Add(accountId); accountInfo.MemberOfLists.Add(listId); }
public void Unfollow(Guid listId, Guid accountId) { FullListInfo listInfo = this.GetFullInfo(listId); AccountStorageTmp.FullAccountInfo accountInfo = this.motherStorage.account.GetFullInfo(accountId); listInfo.Followers.Remove(accountId); accountInfo.FollowerOfLists.Remove(listId); }
internal Guid CreateList(Guid ownerId, string name, string description, bool isPrivate, bool isPersonal) { Guid id = Guid.NewGuid(); AccountStorageTmp.FullAccountInfo accountInfo = this.motherStorage.account.GetFullInfo(ownerId); var listInfo = new FullListInfo { Id = id, Followers = new HashSet<Guid> { ownerId }, ListInfo = new ListInfo(name, description, isPrivate, isPersonal), Members = new HashSet<Guid> { ownerId }, Messages = new List<IMessage>(), OwnerId = ownerId }; accountInfo.MemberOfLists.Add(id); accountInfo.FollowerOfLists.Add(id); this.infoFromId.Add(id, listInfo); return id; }