A bit of refactoring and new functionality for removeAccount method.

This commit is contained in:
Valverde Antonio
2014-07-29 16:21:46 +09:00
parent 437596e6c6
commit 1386b438c0
8 changed files with 26 additions and 18 deletions

View File

@@ -490,14 +490,17 @@ module.exports = syrup.serial()
})
}
plugin.removeAccount = function() {
plugin.removeAccount = function(data) {
return runServiceCommand(
apk.wire.MessageType.REMOVE_ACCOUNT
, new apk.wire.RemoveAccountRequest()
apk.wire.MessageType.DO_REMOVE_ACCOUNT
, new apk.wire.DoRemoveAccountRequest({
type: data.type
, account: data.account
})
)
.timeout(15000)
.then(function(data) {
var response = apk.wire.RemoveAccountResponse.decode(data)
var response = apk.wire.DoRemoveAccountResponse.decode(data)
if (response.success) {
return true
}
@@ -523,9 +526,7 @@ module.exports = syrup.serial()
plugin.setRingerMode = function(mode) {
return runServiceCommand(
apk.wire.MessageType.SET_RINGER_MODE
, new apk.wire.SetRingerModeRequest(
mode
)
, new apk.wire.SetRingerModeRequest(mode)
)
.timeout(10000)
.then(function(data) {