diff options
Diffstat (limited to 'src/core.js')
-rw-r--r-- | src/core.js | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/core.js b/src/core.js index c40d29b..40a2f3b 100644 --- a/src/core.js +++ b/src/core.js @@ -7,6 +7,13 @@ /* global Candy, window, Strophe, jQuery */ +import Action from './core/action.js'; +import ChatRoom from './core/chatRoom.js'; +import ChatRoster from './core/chatRoster.js'; +import ChatUser from './core/chatUser.js'; +import Contact from './core/contact.js'; +import Event from './core/event.js'; + /** Class: Candy.Core * Candy Chat Core * @@ -15,7 +22,7 @@ * (Strophe) Strophe - Strophe JS * (jQuery) $ - jQuery */ -Candy.Core = (function(self, Strophe, $) { +var Core = (function(self, Strophe, $) { /** PrivateVariable: _connection * Strophe connection */ @@ -102,7 +109,7 @@ Candy.Core = (function(self, Strophe, $) { * JID resource to use when connecting to the server. * Specify `''` (an empty string) to request a random resource. */ - resource: Candy.about.name, + resource: undefined, /** Boolean: useParticipantRealJid * If set true, will direct one-on-one chats to participant's real JID rather than their MUC jid */ @@ -277,6 +284,10 @@ Candy.Core = (function(self, Strophe, $) { _anonymousConnection = !_anonymousConnection ? jidOrHost && jidOrHost.indexOf("@") < 0 : true; + if(_options.resource === undefined) { + _options.resource = Candy.about.name; + } + if(jidOrHost && password) { // Respect the resource, if provided var resource = Strophe.getResourceFromJid(jidOrHost); @@ -525,4 +536,13 @@ Candy.Core = (function(self, Strophe, $) { }; return self; -}(Candy.Core || {}, Strophe, jQuery)); +}({}, Strophe, jQuery)); + +Core.Action = Action; +Core.ChatRoom = ChatRoom; +Core.ChatRoster = ChatRoster; +Core.ChatUser = ChatUser; +Core.Contact = Contact; +Core.Event = Event; + +export default Core; |