зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1197008 - Stop assuming 0 is an invalid threadId. r=btseng r=hsinyi
This commit is contained in:
Родитель
98d994acf1
Коммит
e0885aabed
|
@ -463,8 +463,9 @@ MobileMessageManager::GetMessages(const MobileMessageFilter& aFilter,
|
|||
read = aFilter.mRead.Value();
|
||||
}
|
||||
|
||||
bool hasThreadId = !aFilter.mThreadId.IsNull();
|
||||
uint64_t threadId = 0;
|
||||
if (!aFilter.mThreadId.IsNull()) {
|
||||
if (hasThreadId) {
|
||||
threadId = aFilter.mThreadId.Value();
|
||||
}
|
||||
|
||||
|
@ -476,7 +477,7 @@ MobileMessageManager::GetMessages(const MobileMessageFilter& aFilter,
|
|||
ptrNumbers, numbersCount,
|
||||
delivery,
|
||||
hasRead, read,
|
||||
threadId,
|
||||
hasThreadId, threadId,
|
||||
aReverse, cursorCallback,
|
||||
getter_AddRefs(continueCallback));
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -56,6 +56,7 @@ MobileMessageDatabaseService::CreateMessageCursor(bool aHasStartDate,
|
|||
const nsAString& aDelivery,
|
||||
bool aHasRead,
|
||||
bool aRead,
|
||||
bool aHasThreadId,
|
||||
uint64_t aThreadId,
|
||||
bool aReverse,
|
||||
nsIMobileMessageCursorCallback* aCallback,
|
||||
|
|
|
@ -4045,7 +4045,8 @@ MobileMessageDB.prototype = {
|
|||
*/
|
||||
createMessageCursor: function(aHasStartDate, aStartDate, aHasEndDate,
|
||||
aEndDate, aNumbers, aNumbersCount, aDelivery,
|
||||
aHasRead, aRead, aThreadId, aReverse, aCallback) {
|
||||
aHasRead, aRead, aHasThreadId, aThreadId,
|
||||
aReverse, aCallback) {
|
||||
if (DEBUG) {
|
||||
debug("Creating a message cursor. Filters:" +
|
||||
" startDate: " + (aHasStartDate ? aStartDate : "(null)") +
|
||||
|
@ -4053,7 +4054,7 @@ MobileMessageDB.prototype = {
|
|||
" delivery: " + aDelivery +
|
||||
" numbers: " + (aNumbersCount ? aNumbers : "(null)") +
|
||||
" read: " + (aHasRead ? aRead : "(null)") +
|
||||
" threadId: " + aThreadId +
|
||||
" threadId: " + (aHasThreadId ? aThreadId : "(null)") +
|
||||
" reverse: " + aReverse);
|
||||
}
|
||||
|
||||
|
@ -4073,7 +4074,7 @@ MobileMessageDB.prototype = {
|
|||
if (aHasRead) {
|
||||
filter.read = aRead;
|
||||
}
|
||||
if (aThreadId) {
|
||||
if (aHasThreadId) {
|
||||
filter.threadId = aThreadId;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,11 +110,12 @@ MobileMessageDatabaseService.prototype = {
|
|||
|
||||
createMessageCursor: function(aHasStartDate, aStartDate, aHasEndDate,
|
||||
aEndDate, aNumbers, aNumbersCount, aDelivery,
|
||||
aHasRead, aRead, aThreadId, aReverse, aCallback) {
|
||||
aHasRead, aRead, aHasThreadId, aThreadId,
|
||||
aReverse, aCallback) {
|
||||
return this.mmdb.createMessageCursor(aHasStartDate, aStartDate, aHasEndDate,
|
||||
aEndDate, aNumbers, aNumbersCount,
|
||||
aDelivery, aHasRead, aRead, aThreadId,
|
||||
aReverse, aCallback);
|
||||
aDelivery, aHasRead, aRead, aHasThreadId,
|
||||
aThreadId, aReverse, aCallback);
|
||||
},
|
||||
|
||||
markMessageRead: function(aMessageId, aValue, aSendReadReport, aRequest) {
|
||||
|
|
|
@ -15,7 +15,7 @@ interface nsICursorContinueCallback;
|
|||
interface nsIMobileMessageCallback;
|
||||
interface nsIMobileMessageCursorCallback;
|
||||
|
||||
[scriptable, uuid(ead626bc-f5b4-47e1-921c-0b956c9298e0)]
|
||||
[scriptable, uuid(18672be2-c185-4f9c-8af6-2e6ea004de73)]
|
||||
interface nsIMobileMessageDatabaseService : nsISupports
|
||||
{
|
||||
[binaryname(GetMessageMoz)]
|
||||
|
@ -35,6 +35,7 @@ interface nsIMobileMessageDatabaseService : nsISupports
|
|||
[Null(Null), Undefined(Null)] in DOMString delivery,
|
||||
in boolean hasRead,
|
||||
in boolean read,
|
||||
in boolean hasThreadId,
|
||||
in unsigned long long threadId,
|
||||
in boolean reverse,
|
||||
in nsIMobileMessageCursorCallback callback);
|
||||
|
|
|
@ -260,6 +260,7 @@ SmsIPCService::CreateMessageCursor(bool aHasStartDate,
|
|||
const nsAString& aDelivery,
|
||||
bool aHasRead,
|
||||
bool aRead,
|
||||
bool aHasThreadId,
|
||||
uint64_t aThreadId,
|
||||
bool aReverse,
|
||||
nsIMobileMessageCursorCallback* aCursorCallback,
|
||||
|
@ -284,6 +285,7 @@ SmsIPCService::CreateMessageCursor(bool aHasStartDate,
|
|||
data.delivery() = aDelivery;
|
||||
data.hasRead() = aHasRead;
|
||||
data.read() = aRead;
|
||||
data.hasThreadId() = aHasThreadId;
|
||||
data.threadId() = aThreadId;
|
||||
|
||||
return SendCursorRequest(CreateMessageCursorRequest(data, aReverse),
|
||||
|
|
|
@ -847,6 +847,7 @@ MobileMessageCursorParent::DoRequest(const CreateMessageCursorRequest& aRequest)
|
|||
filter.delivery(),
|
||||
filter.hasRead(),
|
||||
filter.read(),
|
||||
filter.hasThreadId(),
|
||||
filter.threadId(),
|
||||
aRequest.reverse(),
|
||||
this,
|
||||
|
|
|
@ -85,6 +85,7 @@ struct SmsFilterData
|
|||
nsString delivery;
|
||||
bool hasRead;
|
||||
bool read;
|
||||
bool hasThreadId;
|
||||
uint64_t threadId;
|
||||
};
|
||||
|
||||
|
|
|
@ -341,6 +341,7 @@ function createMessageCursor(aMmdb, aStartDate = null, aEndDate = null,
|
|||
aDelivery || null,
|
||||
aRead !== null,
|
||||
aRead || false,
|
||||
aThreadId !== null,
|
||||
aThreadId || 0,
|
||||
aReverse || false);
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ dictionary MobileMessageFilter
|
|||
boolean? read = null;
|
||||
|
||||
// Filtering by a message's threadId attribute.
|
||||
[EnforceRange] unsigned long long? threadId = 0;
|
||||
[EnforceRange] unsigned long long? threadId = null;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче