masihyeganeh / yahoomessenger-js

Yahoo! Messenger in nodejs
Other
15 stars 9 forks source link

Setting status feature #3

Closed masihyeganeh closed 10 years ago

masihyeganeh commented 10 years ago

There should be a proper documentation (I don't think anyone need it anyway) but until then, I think this should do.

Just added ability to change status message. to do that, you should first require constants that is used for that;

var Consts = require('yahoomessenger/lib/consts');

To set Yahoo predefined statuses, you should call setAwayStatus method with one of Consts.UserStatus.* constants. For example:

YahooMessenger.setAwayStatus(Consts.UserStatus.NotAtMyDesk);

You can see the rest of possible values in consts.js file

Setting custom statuses is a little more complicated, you should call setCustomAwayStatus method these arguments:

Some examples:

YahooMessenger.setCustomAwayStatus('Hello World');
YahooMessenger.setCustomAwayStatus('BRB', Consts.CustomDND.Idle);
YahooMessenger.setCustomAwayStatus('Click here to visit my website http://www.dogtag.ir/');
YahooMessenger.setCustomAwayStatus('View My Webcam', Consts.CustomDND.DoNotDisturb, Consts.CustomStatusLink.Webcam, 'YSTATUS=1');
zyrllex commented 10 years ago

@masihyeganeh: thank you very much.