-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc029c6
commit c1b1d43
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// telegram.link | ||
// Copyright 2014 Enrico Stara '[email protected]' | ||
// Released under the MIT License | ||
// http://telegram.link | ||
|
||
|
||
// Dependencies: | ||
var api = require('../api'); | ||
var utility = require('../utility'); | ||
|
||
|
||
// *** | ||
|
||
// This module wraps API methods required to manage notifications and settings | ||
|
||
// See [Api Methods](https://core.telegram.org/methods#working-with-notifications-settings) | ||
|
||
// Access only via Client object and `account` instance property | ||
|
||
function Account(client) { | ||
this.client = client; | ||
} | ||
|
||
|
||
// *** | ||
|
||
// **Event: **`'method name'` | ||
|
||
// Each of the following methods emits an event with the same name when done, an `error` event otherwise. | ||
|
||
|
||
// *** | ||
// account.**updateStatus(offline, [callback])** | ||
|
||
// Returns a Promise for update the online user status.. | ||
|
||
// [Click here for more details](https://core.telegram.org/method/account.updateStatus) | ||
|
||
// The code: | ||
Account.prototype.updateStatus = function (offline, callback) { | ||
|
||
offline = offline === false ? new api.type.BoolFalse() : | ||
( offline === true ? new api.type.BoolTrue() : offline); | ||
|
||
return utility.callService(api.service.account.updateStatus, this.client, this.client._channel, callback, arguments); | ||
}; | ||
|
||
|
||
|
||
// Exports the class | ||
module.exports = exports = Account; |