2013-03-08 23:22:25 -08:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "SmsMessage.h"
|
|
|
|
#include "MmsMessage.h"
|
2013-04-08 19:21:54 -07:00
|
|
|
#include "MobileMessageThread.h"
|
2013-03-08 23:22:25 -08:00
|
|
|
#include "MobileMessageService.h"
|
2014-06-26 22:17:47 -07:00
|
|
|
#include "DeletedMessageInfo.h"
|
2013-03-08 23:22:25 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
namespace mobilemessage {
|
|
|
|
|
2014-04-27 00:06:00 -07:00
|
|
|
NS_IMPL_ISUPPORTS(MobileMessageService, nsIMobileMessageService)
|
2013-03-08 23:22:25 -08:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
MobileMessageService::CreateSmsMessage(int32_t aId,
|
2013-04-05 05:15:52 -07:00
|
|
|
uint64_t aThreadId,
|
2013-11-02 03:17:16 -07:00
|
|
|
const nsAString& aIccId,
|
2013-03-08 23:22:25 -08:00
|
|
|
const nsAString& aDelivery,
|
|
|
|
const nsAString& aDeliveryStatus,
|
|
|
|
const nsAString& aSender,
|
|
|
|
const nsAString& aReceiver,
|
|
|
|
const nsAString& aBody,
|
|
|
|
const nsAString& aMessageClass,
|
2014-03-19 19:45:55 -07:00
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
uint64_t aDeliveryTimestamp,
|
|
|
|
bool aRead,
|
2013-03-08 23:22:25 -08:00
|
|
|
JSContext* aCx,
|
|
|
|
nsIDOMMozSmsMessage** aMessage)
|
|
|
|
{
|
|
|
|
return SmsMessage::Create(aId,
|
2013-04-05 05:15:52 -07:00
|
|
|
aThreadId,
|
2013-11-02 03:17:16 -07:00
|
|
|
aIccId,
|
2013-03-08 23:22:25 -08:00
|
|
|
aDelivery,
|
|
|
|
aDeliveryStatus,
|
|
|
|
aSender,
|
|
|
|
aReceiver,
|
|
|
|
aBody,
|
|
|
|
aMessageClass,
|
|
|
|
aTimestamp,
|
2013-09-22 19:31:32 -07:00
|
|
|
aSentTimestamp,
|
2013-11-01 05:00:55 -07:00
|
|
|
aDeliveryTimestamp,
|
2013-03-08 23:22:25 -08:00
|
|
|
aRead,
|
|
|
|
aCx,
|
|
|
|
aMessage);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2014-03-19 19:45:55 -07:00
|
|
|
MobileMessageService::CreateMmsMessage(int32_t aId,
|
|
|
|
uint64_t aThreadId,
|
|
|
|
const nsAString& aIccId,
|
|
|
|
const nsAString& aDelivery,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aDeliveryInfo,
|
2014-03-19 19:45:55 -07:00
|
|
|
const nsAString& aSender,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aReceivers,
|
2014-03-19 19:45:55 -07:00
|
|
|
uint64_t aTimestamp,
|
|
|
|
uint64_t aSentTimestamp,
|
|
|
|
bool aRead,
|
|
|
|
const nsAString& aSubject,
|
|
|
|
const nsAString& aSmil,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aAttachments,
|
2014-03-19 19:45:55 -07:00
|
|
|
uint64_t aExpiryDate,
|
|
|
|
bool aReadReportRequested,
|
|
|
|
JSContext* aCx,
|
2013-03-08 23:22:25 -08:00
|
|
|
nsIDOMMozMmsMessage** aMessage)
|
|
|
|
{
|
|
|
|
return MmsMessage::Create(aId,
|
2013-04-05 05:15:52 -07:00
|
|
|
aThreadId,
|
2013-11-02 03:17:16 -07:00
|
|
|
aIccId,
|
2013-03-20 03:24:48 -07:00
|
|
|
aDelivery,
|
2013-10-22 01:57:25 -07:00
|
|
|
aDeliveryInfo,
|
2013-03-08 23:22:25 -08:00
|
|
|
aSender,
|
|
|
|
aReceivers,
|
|
|
|
aTimestamp,
|
2013-09-22 19:31:32 -07:00
|
|
|
aSentTimestamp,
|
2013-03-08 23:22:25 -08:00
|
|
|
aRead,
|
|
|
|
aSubject,
|
|
|
|
aSmil,
|
|
|
|
aAttachments,
|
2013-05-01 09:22:52 -07:00
|
|
|
aExpiryDate,
|
2013-11-21 23:12:07 -08:00
|
|
|
aReadReportRequested,
|
2013-03-08 23:22:25 -08:00
|
|
|
aCx,
|
|
|
|
aMessage);
|
|
|
|
}
|
|
|
|
|
2013-04-08 19:21:54 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
MobileMessageService::CreateThread(uint64_t aId,
|
2014-01-09 09:39:36 -08:00
|
|
|
JS::Handle<JS::Value> aParticipants,
|
2014-03-19 19:45:55 -07:00
|
|
|
uint64_t aTimestamp,
|
2013-11-06 04:46:06 -08:00
|
|
|
const nsAString& aLastMessageSubject,
|
2013-04-08 19:21:54 -07:00
|
|
|
const nsAString& aBody,
|
|
|
|
uint64_t aUnreadCount,
|
2013-04-26 01:40:42 -07:00
|
|
|
const nsAString& aLastMessageType,
|
2013-04-08 19:21:54 -07:00
|
|
|
JSContext* aCx,
|
|
|
|
nsIDOMMozMobileMessageThread** aThread)
|
|
|
|
{
|
|
|
|
return MobileMessageThread::Create(aId,
|
|
|
|
aParticipants,
|
|
|
|
aTimestamp,
|
2013-11-06 04:46:06 -08:00
|
|
|
aLastMessageSubject,
|
2013-04-08 19:21:54 -07:00
|
|
|
aBody,
|
|
|
|
aUnreadCount,
|
2013-04-26 01:40:42 -07:00
|
|
|
aLastMessageType,
|
2013-04-08 19:21:54 -07:00
|
|
|
aCx,
|
|
|
|
aThread);
|
|
|
|
}
|
|
|
|
|
2014-06-26 22:17:47 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
MobileMessageService::CreateDeletedMessageInfo(int32_t* aMessageIds,
|
|
|
|
uint32_t aMsgCount,
|
|
|
|
uint64_t* aThreadIds,
|
|
|
|
uint32_t aThreadCount,
|
|
|
|
nsIDeletedMessageInfo** aDeletedInfo)
|
|
|
|
{
|
|
|
|
return DeletedMessageInfo::Create(aMessageIds,
|
|
|
|
aMsgCount,
|
|
|
|
aThreadIds,
|
|
|
|
aThreadCount,
|
|
|
|
aDeletedInfo);
|
|
|
|
}
|
|
|
|
|
2013-03-08 23:22:25 -08:00
|
|
|
} // namespace mobilemessage
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|