Confirmed users
1,340
edits
(→Proposed API: add SmsMessage.delivery and update comments) |
No edit summary |
||
| (9 intermediate revisions by 3 users not shown) | |||
| Line 26: | Line 26: | ||
SMSRequest getMessage(in long id); // request.result == SMSMessage | SMSRequest getMessage(in long id); // request.result == SMSMessage | ||
SMSRequest getMessages(in SMSFilter filter, bool reverse); // request.result == SMSIterator | SMSRequest getMessages(in SMSFilter filter, bool reverse); // request.result == SMSIterator | ||
SMSRequest markMessageRead(long id, boolean aValue); // request.result == boolean | |||
}; | }; | ||
| Line 48: | Line 49: | ||
readonly attribute DOMString body; | readonly attribute DOMString body; | ||
readonly attribute Date timestamp; | readonly attribute Date timestamp; | ||
readonly attribute boolean | readonly attribute boolean read; | ||
}; | }; | ||
| Line 54: | Line 55: | ||
* We have .sender and .receiver because someone can have multiple number or change numbers. We could merge them to .number if that seems necessary. | * We have .sender and .receiver because someone can have multiple number or change numbers. We could merge them to .number if that seems necessary. | ||
[Constructor] | |||
interface SmsFilter { | interface SmsFilter { | ||
Date | Date? startDate; | ||
Date | Date? endDate; | ||
DOMString[] | DOMString[]? numbers; | ||
DOMString | [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString] | ||
boolean | DOMString? delivery; // whether "sent" or "received" | ||
boolean? read; | |||
}; | }; | ||
Comments: | Comments: | ||
* | * When we will have MMS support, we would have to add a .type property to allow looking for SMS or MMS. | ||
* | * For the moment, there is no way to filter according to the content of a message because we didn't find a nice way to do it. This could be added later though. | ||
interface SmsIterator { | interface SmsIterator { | ||
| Line 74: | Line 76: | ||
In addition of these interfaces, there is a new event: | In addition of these interfaces, there is a new event: | ||
[Constructor(DOMString type, optional SmsEventInit smsEventInitDict)] | |||
interface SmsEvent : Event | interface SmsEvent : Event | ||
{ | { | ||
readonly attribute SmsMessage message; | |||
}; | |||
dictionary SmsEventInit : EventInit { | |||
SmsMessage message; | |||
} | |||
The ''SmsEvent'' is used for the following events: | The ''SmsEvent'' is used for the following events: | ||
| Line 89: | Line 93: | ||
These events carry the SMS in ''event.message''. | These events carry the SMS in ''event.message''. | ||
A security story has to be defined for these events. | A security story has to be defined for these events. | ||
[[Category:Web APIs]] | |||