Skip to content

Commit

Permalink
Updating autojoin invites plugin and readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Melissa Noelle committed Aug 22, 2014
1 parent a3cd0c2 commit 7990559
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions autojoininvites/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

A plugin for Candy Chat to automatically join any and all incoming MUC room invites.

## Integrations/Dependencies
Integrates with the Bookmark plugin.


## Usage
Include the JavaScript file:
Expand Down
12 changes: 6 additions & 6 deletions autojoininvites/autojoininvites.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** File: autojoininvites.js
* Candy Plugin Auto-Join Incoming MUC Invites
* Author: Melissa Adamaitis <madamei@mojolingo.com>
* Integrates with Bookmark plugin.
*/

var CandyShop = (function(self) { return self; }(CandyShop || {}));
Expand All @@ -22,12 +23,11 @@ CandyShop.AutoJoinInvites = (function(self, Candy, $) {
*/
self.init = function(){
$(Candy).on('candy:core:chat:invite',function(ev, obj) {
// JIDs in automatic invitations are escaped,
// but Room.Join expects unescaped JID
var roomJid = Candy.Util.unescapeJid(obj.roomJid);

Candy.Core.Action.Jabber.Room.Join(roomJid, null);
})
if (CandyShop.Bookmark) {
CandyShop.Bookmark.add(obj.roomJid);
}
Candy.Core.Action.Jabber.Room.Join(obj.roomJid, null);
});
};

return self;
Expand Down

1 comment on commit 7990559

@benlangfeld
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also commit this to the dev branch.

Please sign in to comment.