SEARCH-154 - get latest messages timestamp

This commit is contained in:
Keerthi Niranjan
2017-08-16 11:21:06 +05:30
parent fe8d403725
commit c94bc0c327
3 changed files with 26 additions and 2 deletions

View File

@@ -232,6 +232,24 @@ class Search {
});
}
getLatestMessageTimestamp() {
let self = this;
return new Promise(function (resolve, reject) {
libSymphonySearch.symSEGetLastMessageTimestampAsync(self.indexFolderName, function (err, res) {
if (err) {
reject(new Error(err));
}
const returnedResult = res;
try {
let ret = returnedResult.readCString();
resolve(ret);
} finally {
libSymphonySearch.symSEFreeResult(returnedResult);
}
})
})
}
/**
* This the query constructor
* for the query search function