public DeleteArchiveStub DeleteArchive(string roomGuid, string lastItemGuidString, int sessionID, string lastActionTicks, string pageUrl, StateStub[] roomState) { WaitIfDevEnv(); Guid guid = roomGuid.UnPackGuid(); Chat.RoomSpec spec = Chat.RoomSpec.FromGuid(guid); if (Usr.Current == null || Usr.Current.IsSkeleton || Usr.Current.Banned) throw new LoginPermissionException(); if (spec == null) throw new InvalidRoomException(); if (!spec.IsPrivateChatRoom) throw new InvalidRoomException(); if (!spec.CheckPermission(Usr.Current, true)) throw new WritePermissionException(); storeRoomState(roomState, Usr.Current.K); lastActionTicks = resetLastActionAndSessionID(sessionID); //delete archive... spec.DeleteArchive(); DeleteArchiveStub das = new DeleteArchiveStub(); das.roomGuid = roomGuid; RefreshStub r = refreshPrivate(false, lastItemGuidString, sessionID, lastActionTicks, pageUrl, Usr.Current.K, roomState); das.guestRefreshStubs = r.guestRefreshStubs; das.itemsJson = r.itemsJson; das.lastActionTicks = r.lastActionTicks; das.lastItemGuidReturned = r.lastItemGuidReturned; return das; }
public void DeleteArchiveSuccessCallback(DeleteArchiveStub s, object userContext, string methodName) { if (s != null) { if (DoneDeleteArchive != null) DoneDeleteArchive(this, new RoomGuidEventArgs(s.roomGuid)); processItems(s.itemsJson, s.lastActionTicks, s.lastItemGuidReturned, methodName, s.guestRefreshStubs, "", false); } continueProcessingCriticalRequestQueue(); }