SHARE
TWEET

Untitled

a guest Jun 13th, 2011 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   createTag: function(aTagName) {
  2.     return Components.classes["@instantbird.org/purple/tags-service;1"]
  3.                      .getService(Ci.imITagsService)
  4.                      .createTag(aTagName);
  5.   },
  6.  
  7.   getBuddy: function(normalizedName) {
  8.     return Components.classes["@instantbird.org/purple/contacts-service;1"]
  9.               .getService(Ci.imIContactsService)
  10.               .getBuddyByNameAndProtocol(normalizedName, this.protocol);
  11.   },
  12.  
  13.   addBuddy: function(aTagName, aName) {
  14.     var b = this.getBuddy(normalize(aName), this.protocol);
  15.     var buddy;
  16.     var tag = this.createTag(aTagName);
  17.     dump(b);
  18.     if(b) {
  19.       buddy = new AccountBuddy(this, b, tag);
  20.     } else {
  21.       buddy = new AccountBuddy(this, null, tag, aName);
  22.  
  23.       Components.classes["@instantbird.org/purple/contacts-service;1"]
  24.                 .getService(Ci.imIContactsService)
  25.                 .accountBuddyAdded(buddy);
  26.     }
  27.  
  28.     buddy.setStatus(Ci.imIStatusInfo.STATUS_AVAILABLE, 'wowzaaa', 10);
  29.     this._buddies[normalize(aName)] = buddy;
  30.   },
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top