social_stream-presence 0.1.2 → 0.1.4

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.
Files changed (34) hide show
  1. data/app/assets/javascripts/chat_interface_manager.js.erb +43 -5
  2. data/app/assets/javascripts/chat_utilities.js +26 -0
  3. data/app/assets/javascripts/xmpp_client_management.js.erb +5 -1
  4. data/app/assets/stylesheets/chat.css +24 -0
  5. data/app/views/chat/_off.html.erb +0 -3
  6. data/app/views/xmpp/active_users.html.erb +1 -1
  7. data/config/locales/en.yml +4 -2
  8. data/config/locales/es.yml +3 -1
  9. data/config/routes.rb +3 -3
  10. data/ejabberd/conf/ssconfig_example.cfg +14 -20
  11. data/ejabberd/ejabberd_files.zip +0 -0
  12. data/ejabberd/ejabberd_scripts/authentication_script +3 -13
  13. data/ejabberd/ejabberd_scripts/development_scripts/show_config.sh +13 -9
  14. data/ejabberd/ejabberd_scripts/emanagement +65 -22
  15. data/ejabberd/ejabberd_scripts/reset_connection_script +1 -1
  16. data/ejabberd/ejabberd_scripts/set_connection_script +1 -1
  17. data/ejabberd/ejabberd_scripts/set_presence_script +1 -1
  18. data/ejabberd/ejabberd_scripts/set_script_header.sh +112 -0
  19. data/ejabberd/ejabberd_scripts/synchronize_presence_script +4 -2
  20. data/ejabberd/ejabberd_scripts/unset_connection_script +1 -1
  21. data/ejabberd/ejabberd_scripts/unset_presence_script +48 -0
  22. data/ejabberd/installer.sh +267 -0
  23. data/ejabberd/mod_sspresence/mod_sspresence.beam +0 -0
  24. data/ejabberd/mod_sspresence/mod_sspresence.erl +31 -99
  25. data/lib/generators/social_stream/presence/install_generator.rb +1 -1
  26. data/lib/generators/social_stream/presence/templates/initializer.rb +6 -4
  27. data/lib/social_stream-presence.rb +2 -1
  28. data/lib/social_stream/presence/models/buddy_manager.rb +1 -1
  29. data/lib/social_stream/presence/version.rb +1 -1
  30. data/lib/social_stream/presence/xmpp_server_order.rb +128 -28
  31. data/lib/tasks/presence/installer.rake +100 -0
  32. data/social_stream-presence.gemspec +2 -0
  33. data/vendor/assets/javascripts/jquery.ui.chatbox.js +18 -2
  34. metadata +23 -5
@@ -0,0 +1,100 @@
1
+ namespace :presence do
2
+ desc 'Copy ejabberd files to the xmpp server and write configuration files'
3
+ task :install => [ 'presence:install:copy_xmpp_server_files', 'presence:install_xmpp_server' , 'presence:autoconfigure_xmpp_server' ]
4
+
5
+ namespace :install do
6
+
7
+ desc "Copy ejabberd files to the xmpp server"
8
+ task :copy_xmpp_server_files => :environment do
9
+ puts "Starting presence:install:copy_xmpp_server_files"
10
+
11
+ presence_root = File.expand_path("../../../../", __FILE__)
12
+ opath = presence_root + "/ejabberd";
13
+ dpath = SocialStream::Presence.scripts_path + "/sstream_ejabberd_files";
14
+
15
+ #Cleaning dpath
16
+ SocialStream::Presence::XmppServerOrder::executeCommands(["rm -r " + dpath,"mkdir -p " + dpath])
17
+ #Copy folders
18
+ SocialStream::Presence::XmppServerOrder::copyFolder(opath,dpath)
19
+
20
+ puts "Social Stream Ejabberd files copied to " + dpath + " in Xmpp Server"
21
+ puts "Copy_xmpp_server_files: Task complete"
22
+ end
23
+
24
+
25
+ desc "Copy ejabberd files to the xmpp server and write configuration files"
26
+ task :xmpp_server, [:sudo_password] => :environment do |t, args|
27
+ puts "Starting presence:install_xmpp_server"
28
+
29
+ user = SocialStream::Presence::XmppServerOrder::getExecutorUser
30
+ unless user
31
+ puts "Specify ssh_user for remote access!"
32
+ exit 0
33
+ end
34
+
35
+ #Get password
36
+ if args[:sudo_password]
37
+ password = args[:sudo_password]
38
+ else
39
+ puts "[sudo] password for " + user + ":\n"
40
+ system "stty -echo"
41
+ password = STDIN.gets.chomp
42
+ system "stty echo"
43
+
44
+ if password.gsub(" ","")==""
45
+ puts "Please specify [sudo] password for " + user + " to execute the installer"
46
+ puts "You can provided it from keyboard input or execute the task as presence:install:xmpp_server[sudo_password]"
47
+ exit 0
48
+ end
49
+ end
50
+
51
+ #Copy files
52
+ Rake::Task["presence:install:copy_xmpp_server_files"].execute
53
+
54
+ commands = []
55
+
56
+ #Give permissions to installation script
57
+ commands << "chmod +x " + SocialStream::Presence.scripts_path + "/sstream_ejabberd_files/installer.sh"
58
+
59
+ #Get autoconfiguration values
60
+ options = SocialStream::Presence::XmppServerOrder::autoconf([])
61
+
62
+ #Execute installation script
63
+ commands << "echo " + password + " | sudo -S " + SocialStream::Presence.scripts_path + "/sstream_ejabberd_files/installer.sh \"ejabberd_module_path=" + SocialStream::Presence.ejabberd_module_path + "\" \"scripts_path=" + SocialStream::Presence.scripts_path + "\" \"" + options + "\""
64
+
65
+ #Execution order
66
+ output = SocialStream::Presence::XmppServerOrder::executeCommands(commands)
67
+
68
+ puts output
69
+ puts "Installation complete"
70
+ end
71
+
72
+
73
+ desc "Autoconfigure options"
74
+ task :autoconfigure_xmpp_server, [:options] => :environment do |t, args|
75
+ puts "Starting presence:install:autoconfigure_xmpp_server"
76
+
77
+ if args[:options]
78
+ manual_options = args[:options].split(';')
79
+ manual_options.each do |option|
80
+ if option.split('=').length != 2
81
+ puts "Syntax error: presence:install:autoconfigure_xmpp_server[key1=value1;key2=value2;removeThiskey=remove]"
82
+ end
83
+ end
84
+ else
85
+ manual_options = []
86
+ end
87
+
88
+ commands = []
89
+ options = SocialStream::Presence::XmppServerOrder::autoconf(manual_options)
90
+ commands << SocialStream::Presence.scripts_path + "/sstream_ejabberd_files/installer.sh \"onlyconf=true\" \"" + options + "\""
91
+
92
+ #Execution order
93
+ output = SocialStream::Presence::XmppServerOrder::executeCommands(commands)
94
+
95
+ puts output
96
+ puts "Autoconfigure complete"
97
+ end
98
+
99
+ end
100
+ end
@@ -24,6 +24,8 @@ Gem::Specification.new do |s|
24
24
  s.add_runtime_dependency "xmpp4r"
25
25
 
26
26
  s.add_runtime_dependency "net-ssh"
27
+
28
+ s.add_runtime_dependency "net-sftp"
27
29
 
28
30
  s.add_development_dependency "ruby-debug19"
29
31
 
@@ -167,7 +167,9 @@
167
167
  .addClass('ui-icon-minusthick ' + 'chat-thick ' + ' chat-minusthick')
168
168
  .text('minimize')
169
169
  .appendTo(uiChatboxTitlebarMinimize),
170
- // content
170
+
171
+
172
+ // content
171
173
  uiChatboxContent = (self.uiChatboxContent = $('<div></div>'))
172
174
  .addClass('ui-widget-content ' +
173
175
  'ui-chatbox-content '
@@ -179,6 +181,19 @@
179
181
  'ui-chatbox-log'
180
182
  )
181
183
  .appendTo(uiChatboxContent),
184
+
185
+ //Notification div
186
+ uiChatboxNotify = (self.uiChatboxNotify = $('<div></div>'))
187
+ .addClass('ui-widget-content ' +
188
+ 'ui-chatbox-notify'
189
+ )
190
+ .click(function(event) {
191
+ // anything?
192
+ self.uiChatboxNotify.fadeOut();
193
+ })
194
+ .appendTo(uiChatboxContent),
195
+
196
+
182
197
  uiChatboxInput = (self.uiChatboxInput = $('<div></div>'))
183
198
  .addClass('ui-widget-content ' +
184
199
  'ui-chatbox-input'
@@ -195,7 +210,8 @@
195
210
  .appendTo(uiChatboxInput)
196
211
  .keydown(function(event) {
197
212
  if(event.keyCode && event.keyCode == $.ui.keyCode.ENTER) {
198
- if (((typeof floodControl == 'function')&&(floodControl()))||((typeof floodControl != 'function'))) {
213
+ var userChatDataInputControlBoolean = (((typeof userChatDataInputControl == 'function')&&(userChatDataInputControl()))||((typeof userChatDataInputControl != 'function')));
214
+ if (userChatDataInputControlBoolean) {
199
215
  msg = $.trim($(this).val());
200
216
  if (msg.length > 0) {
201
217
  self.options.messageSent(self.options.id, self.options.user, msg);
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Aldo Gordillo
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-11-28 00:00:00 +01:00
17
+ date: 2011-12-07 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -59,7 +59,7 @@ dependencies:
59
59
  type: :runtime
60
60
  version_requirements: *id003
61
61
  - !ruby/object:Gem::Dependency
62
- name: ruby-debug19
62
+ name: net-sftp
63
63
  prerelease: false
64
64
  requirement: &id004 !ruby/object:Gem::Requirement
65
65
  none: false
@@ -69,8 +69,21 @@ dependencies:
69
69
  segments:
70
70
  - 0
71
71
  version: "0"
72
- type: :development
72
+ type: :runtime
73
73
  version_requirements: *id004
74
+ - !ruby/object:Gem::Dependency
75
+ name: ruby-debug19
76
+ prerelease: false
77
+ requirement: &id005 !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ segments:
83
+ - 0
84
+ version: "0"
85
+ type: :development
86
+ version_requirements: *id005
74
87
  description: Social Stream is a Ruby on Rails engine providing your application with social networking features and activity streams.
75
88
  email:
76
89
  - iamchrono@gmail.com
@@ -127,6 +140,7 @@ files:
127
140
  - db/migrate/20111116194112_add_chat_enabled_column_to_user.rb
128
141
  - ejabberd/conf/ejabberd_example.cfg
129
142
  - ejabberd/conf/ssconfig_example.cfg
143
+ - ejabberd/ejabberd_files.zip
130
144
  - ejabberd/ejabberd_scripts/authentication_script
131
145
  - ejabberd/ejabberd_scripts/development_scripts/compile_module
132
146
  - ejabberd/ejabberd_scripts/development_scripts/generate_random_password
@@ -139,8 +153,11 @@ files:
139
153
  - ejabberd/ejabberd_scripts/reset_connection_script
140
154
  - ejabberd/ejabberd_scripts/set_connection_script
141
155
  - ejabberd/ejabberd_scripts/set_presence_script
156
+ - ejabberd/ejabberd_scripts/set_script_header.sh
142
157
  - ejabberd/ejabberd_scripts/synchronize_presence_script
143
158
  - ejabberd/ejabberd_scripts/unset_connection_script
159
+ - ejabberd/ejabberd_scripts/unset_presence_script
160
+ - ejabberd/installer.sh
144
161
  - ejabberd/mod_admin_extra/mod_admin_extra.beam
145
162
  - ejabberd/mod_admin_extra/mod_admin_extra.erl
146
163
  - ejabberd/mod_sspresence/mod_sspresence.beam
@@ -154,6 +171,7 @@ files:
154
171
  - lib/social_stream/presence/version.rb
155
172
  - lib/social_stream/presence/xmpp_server_order.rb
156
173
  - lib/social_stream/views/settings/presence.rb
174
+ - lib/tasks/presence/installer.rake
157
175
  - lib/tasks/presence/synchronize.rake
158
176
  - social_stream-presence.gemspec
159
177
  - spec/demo/.gitignore