jegolize 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.9
1
+ 0.1.10
@@ -20,7 +20,7 @@ class JegolController < ApplicationController
20
20
  server_url,
21
21
  {:timeout => 20})
22
22
 
23
- render :json => {:jid=>@session_jid, :sid=>@session_id, :rid=>@session_random_id, :room => room, :nickname => nickname}
23
+ render :json => {:jid=>@session_jid, :sid=>@session_id, :rid=>@session_random_id, :room => room, :nickname => nickname, :bosh_service => JEGOL_CONFIG['bosh_service']}
24
24
  end
25
25
 
26
26
  def get_jid
data/config/jegol.yml CHANGED
@@ -26,4 +26,7 @@
26
26
  muc_namespace: conference.<TODO: XMPP.MYSERVER.COM>
27
27
 
28
28
  #chat rooms are named [jegolizating_<ID>]
29
- muc_name_constant: jegolizing_
29
+ muc_name_constant: jegolizing_
30
+
31
+ #XMPP BOSH service url eg. relative url with rewriting /http-bind/, or absolute http://XMPP.MYSERVER.COM/http-bind/
32
+ bosh_service: <TODO: BOSH-SERVICE-URL>
data/jegolize.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jegolize}
8
- s.version = "0.1.9"
8
+ s.version = "0.1.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alemeshet Alemu"]
@@ -1,6 +1,8 @@
1
- var BOSH_SERVICE = '/http-bind/';//'http://dev.qworky.net:5280/http-bind/';//
2
-
1
+ /*
2
+ * @auther: Alemeshet Alemu
3
+ */
3
4
  var JeGol = {
5
+ bosh_service: '/http-bind/',
4
6
  connection: null,
5
7
  room: null,
6
8
  nickname: null,
@@ -136,26 +138,12 @@ var JeGol = {
136
138
  * Establish connection
137
139
  * option 2- from server side json store request for SID
138
140
  */
139
- loginSIDFromServer : function(serviceURL){
141
+ loginSIDFromServer : function(data){
140
142
  Strophe.info('Login started...');
141
143
 
142
- Strophe.debug('Getting SID from SID service...');
143
-
144
- $.getJSON(serviceURL.jsonURL, function(data) {
145
- Strophe.debug('SID service returned...');
146
- try {
147
- JeGol.room = data.room;
148
- JeGol.nickname = data.nickname;
149
- JeGol.connection.attach(data.jid, data.sid, data.rid, JeGol.onConnect);
144
+ JeGol.connection.attach(data.jid, data.sid, data.rid, JeGol.onConnect);
150
145
 
151
- Strophe.info('Login complete.');
152
-
153
- }
154
- catch(e){
155
- Strophe.error('Login failed: ' + e.message);
156
- }
157
-
158
- });
146
+ Strophe.info('Login complete.');
159
147
  },
160
148
  /**
161
149
  * Establish connection
@@ -479,9 +467,23 @@ $(document).bind('jegol_init', function(e, d){
479
467
  * On Connect event - initialize a strope connection and login from authenticated session service URL
480
468
  */
481
469
  $(document).bind('connect', function(e, d){
482
- JeGol.connection = new Strophe.Connection(BOSH_SERVICE);
483
- $('#jegol_connection_status').text('connecting...');
484
- JeGol.loginSIDFromServer({jsonURL: $('#jegol_service_url').val()});
470
+ Strophe.debug('Getting SID from SID service...');
471
+
472
+ var jsonURL = $('#jegol_service_url').val();
473
+ $.getJSON(jsonURL, function(data) {
474
+ Strophe.debug('SID service returned...');
475
+ try {
476
+ JeGol.room = data.room;
477
+ JeGol.nickname = data.nickname;
478
+ JeGol.bosh_service = data.bosh_service;
479
+
480
+ JeGol.connection = new Strophe.Connection(JeGol.bosh_service);
481
+ JeGol.loginSIDFromServer(data);
482
+ }
483
+ catch(e){
484
+ Strophe.error('Login failed: ' + e.message);
485
+ }
486
+ });
485
487
  });
486
488
 
487
489
  /**
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jegolize
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.9
5
+ version: 0.1.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - Alemeshet Alemu
@@ -157,7 +157,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - ">="
159
159
  - !ruby/object:Gem::Version
160
- hash: 288232335
160
+ hash: -178680915
161
161
  segments:
162
162
  - 0
163
163
  version: "0"