NS_IMETHODIMP SmsIPCService::DeleteMessage(int32_t *aMessageIds, uint32_t aSize, nsIMobileMessageCallback* aRequest) { DeleteMessageRequest data; data.messageIds().AppendElements(aMessageIds, aSize); return SendRequest(data, aRequest); }
bool SmsRequestParent::DoRequest(const DeleteMessageRequest& aRequest) { nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsIMobileMessageDatabaseService> dbService = do_GetService(MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID); if (dbService) { const InfallibleTArray<int32_t>& messageIds = aRequest.messageIds(); rv = dbService->DeleteMessage(const_cast<int32_t *>(messageIds.Elements()), messageIds.Length(), this); } if (NS_FAILED(rv)) { return NS_SUCCEEDED(NotifyDeleteMessageFailed(nsIMobileMessageCallback::INTERNAL_ERROR)); } return true; }