Remove the JSXC/Prosody integration.

As per discussion on https://discourse.diasporafoundation.org/t/removing-diaspora-s-current-chat-integration/2718, nobody raised serious concerns or objections. Given future plans, we do not think having an unfinished implementation of something that likely will not get finished in the current form is worth it. So let's get rid of it.
This commit is contained in:
Dennis Schubert 2019-10-18 23:14:14 +02:00
parent 995f3394a8
commit 862fa38f8b
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
45 changed files with 39 additions and 472 deletions

View file

@ -16,7 +16,6 @@
"Handlebars": false,
"HandlebarsTemplates": false,
"ImagePaths": false,
"jsxc": false,
"L": false,
"OSM": false,
"PerfectScrollbar": false,

5
.gitignore vendored
View file

@ -1,8 +1,3 @@
# XMPP certificates, keys and user data
config/certs/*.crt
config/certs/*.key
config/prosody.cfg.lua
# Trademark sillyness
app/views/home/_show.*
app/views/terms/terms.*

View file

@ -1,5 +1,11 @@
# 0.8.0.0
## The chat integration has been removed
After [a discussion with our community on Discourse](https://discourse.diasporafoundation.org/t/2718), we decided to remove the pieces of XMPP chat integration that were put in place a while ago. When we first added the chat support, we merged the implementation in an unfinished state in the hopes that the open issues will be addressed eventually, and the implementation would end up more polished. This ended up not being the case. After careful consideration and discussion, we did not manage to come up with clear reasons why we need a chat implementation, so we decided that the best way forward would be to remove it.
Although the chat was never enabled per default and was marked as experimental, some production pods did set up the integration and offered an XMPP service to their users. After this release, diaspora\* will no longer contain a chat applet, so users will no longer be able to use the webchat inside diaspora\*. The existing module that is used to enable users to authenticate to Prosody using their diaspora\* credentials will continue to work, but contact list synchronization might not work without further changes to the Prosody module, which is developed independently from this project.
## Refactor
* Add bootstrapping for using ECMAScript 6 with automatic transpiling for compatibility [#7581](https://github.com/diaspora/diaspora/pull/7581)
* Remove backporting of mention syntax [#7788](https://github.com/diaspora/diaspora/pull/7788)

View file

@ -175,10 +175,6 @@ gem "openid_connect", "1.1.8"
gem "active_model_serializers", "0.9.7"
# XMPP chat dependencies
gem "diaspora-prosody-config", "0.0.7"
gem "rails-assets-diaspora_jsxc", "0.1.5.develop.7", source: "https://rails-assets.org"
# Tags
gem "acts-as-taggable-on", "6.0.0"

View file

@ -184,7 +184,6 @@ GEM
devise_lastseenable (0.0.6)
devise
rails (>= 3.0.4)
diaspora-prosody-config (0.0.7)
diaspora_federation (0.2.6)
faraday (>= 0.9.0, < 0.16.0)
faraday_middleware (>= 0.10.0, < 0.14.0)
@ -538,31 +537,18 @@ GEM
rails-assets-corejs-typeahead (1.2.1)
rails-assets-jquery (>= 1.11)
rails-assets-cropperjs (1.4.3)
rails-assets-diaspora_jsxc (0.1.5.develop.7)
rails-assets-emojione (~> 2.0.1)
rails-assets-favico.js (>= 0.3.10, < 0.4)
rails-assets-jquery-colorbox (~> 1.6.3)
rails-assets-jquery-fullscreen-plugin (~> 0.5.0)
rails-assets-jquery.slimscroll (~> 1.3.6)
rails-assets-jquery.ui (~> 1.11.4)
rails-assets-emojione (2.0.1)
rails-assets-favico.js (0.3.10)
rails-assets-fine-uploader (5.13.0)
rails-assets-highlightjs (9.12.0)
rails-assets-jasmine (3.4.0)
rails-assets-jasmine-ajax (4.0.0)
rails-assets-jasmine (~> 3)
rails-assets-jquery (3.4.1)
rails-assets-jquery-colorbox (1.6.4)
rails-assets-jquery (>= 1.3.2)
rails-assets-jquery-fullscreen-plugin (0.5.0)
rails-assets-jquery-placeholder (2.3.1)
rails-assets-jquery (>= 1.6)
rails-assets-jquery-textchange (0.2.3)
rails-assets-jquery
rails-assets-jquery.are-you-sure (1.9.0)
rails-assets-jquery (>= 1.4.2)
rails-assets-jquery.slimscroll (1.3.8)
rails-assets-jquery.ui (1.11.4)
rails-assets-jquery (>= 1.6)
rails-assets-markdown-it--markdown-it-for-inline (0.1.1)
@ -812,7 +798,6 @@ DEPENDENCIES
devise (= 4.6.1)
devise-two-factor (= 3.0.3)
devise_lastseenable (= 0.0.6)
diaspora-prosody-config (= 0.0.7)
diaspora_federation-json_schema (= 0.2.6)
diaspora_federation-rails (= 0.2.6)
diaspora_federation-test (= 0.2.6)
@ -878,7 +863,6 @@ DEPENDENCIES
rails-assets-bootstrap-markdown (= 2.10.0)!
rails-assets-corejs-typeahead (= 1.2.1)!
rails-assets-cropperjs (= 1.4.3)!
rails-assets-diaspora_jsxc (= 0.1.5.develop.7)!
rails-assets-fine-uploader (= 5.13.0)!
rails-assets-highlightjs (= 9.12.0)!
rails-assets-jasmine-ajax (= 4.0.0)!

View file

@ -2,7 +2,6 @@
//= link jquery3.js
//= link jquery_ujs.js
//= link main.js
//= link jsxc.js
//= link bookmarklet.js
//= link mobile/bookmarklet.js
//= link mobile/mobile.js

View file

@ -5,14 +5,12 @@ app.pages.Contacts = Backbone.View.extend({
el: "#contacts_container",
events: {
"click #chat_privilege_toggle" : "toggleChatPrivilege",
"click #change_aspect_name" : "showAspectNameForm",
"click .conversation_button": "showMessageModal",
"click .invitations-button": "showInvitationsModal"
},
initialize: function(opts) {
this.chatToggle = $("#chat_privilege_toggle i");
this.stream = opts.stream;
this.stream.render();
$("#people-stream.contacts .header i").tooltip({"placement": "bottom"});
@ -27,22 +25,6 @@ app.pages.Contacts = Backbone.View.extend({
this.setupAspectSorting();
},
toggleChatPrivilege: function() {
if (this.chatToggle.hasClass("enabled")) {
this.chatToggle.tooltip("destroy")
.removeClass("enabled")
.removeAttr("data-original-title")
.attr("title", Diaspora.I18n.t("contacts.aspect_chat_is_not_enabled"))
.tooltip({"placement": "bottom"});
} else {
this.chatToggle.tooltip("destroy")
.addClass("enabled")
.removeAttr("data-original-title")
.attr("title", Diaspora.I18n.t("contacts.aspect_chat_is_enabled"))
.tooltip({"placement": "bottom"});
}
},
showAspectNameForm: function() {
$(".header > h3").hide();
var aspectName = $.trim($(".header h3 #aspect_name").text());

View file

@ -9,8 +9,7 @@ app.views.Help = app.views.StaticContentView.extend({
"click .faq-link-sharing": "sharing",
"click .faq-link-posts-and-posting": "postsAndPosting",
"click .faq-link-tags": "tags",
"click .faq-link-keyboard-shortcuts": "keyboardShortcuts",
"click .faq-link-chat": "chat"
"click .faq-link-keyboard-shortcuts": "keyboardShortcuts"
},
initialize : function() {
@ -39,31 +38,22 @@ app.views.Help = app.views.StaticContentView.extend({
}
};
this.CHAT_SUBS = {
add_contact_roster_a: {
toggle_privilege: this.getChatIcons(),
contacts_page: this.linkHtml(Routes.contacts(), Diaspora.I18n.t("chat.contacts_page"))
}
};
this.data = {
title_header: Diaspora.I18n.t( 'title_header' ),
title_getting_help: Diaspora.I18n.t( 'getting_help.title' ),
title_account_and_data_management: Diaspora.I18n.t( 'account_and_data_management.title' ),
title_aspects: Diaspora.I18n.t( 'aspects.title' ),
title_mentions: Diaspora.I18n.t( 'mentions.title' ),
title_pods: Diaspora.I18n.t( 'pods.title' ),
title_posts_and_posting: Diaspora.I18n.t( 'posts_and_posting.title' ),
title_private_posts: Diaspora.I18n.t( 'private_posts.title' ),
title_public_posts: Diaspora.I18n.t( 'public_posts.title' ),
title_resharing_posts: Diaspora.I18n.t( 'resharing_posts.title' ),
title_header: Diaspora.I18n.t("title_header"),
title_getting_help: Diaspora.I18n.t("getting_help.title"),
title_account_and_data_management: Diaspora.I18n.t("account_and_data_management.title"),
title_aspects: Diaspora.I18n.t("aspects.title"),
title_mentions: Diaspora.I18n.t("mentions.title"),
title_pods: Diaspora.I18n.t("pods.title"),
title_posts_and_posting: Diaspora.I18n.t("posts_and_posting.title"),
title_private_posts: Diaspora.I18n.t("private_posts.title"),
title_public_posts: Diaspora.I18n.t("public_posts.title"),
title_resharing_posts: Diaspora.I18n.t("resharing_posts.title"),
title_profile: Diaspora.I18n.t("profile.title"),
title_sharing: Diaspora.I18n.t( 'sharing.title' ),
title_tags: Diaspora.I18n.t( 'tags.title' ),
title_keyboard_shortcuts: Diaspora.I18n.t( 'keyboard_shortcuts.title' ),
title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' ),
title_chat: Diaspora.I18n.t( 'chat.title' ),
chat_enabled: this.chatEnabled()
title_sharing: Diaspora.I18n.t("sharing.title"),
title_tags: Diaspora.I18n.t("tags.title"),
title_keyboard_shortcuts: Diaspora.I18n.t("keyboard_shortcuts.title"),
title_miscellaneous: Diaspora.I18n.t("miscellaneous.title")
};
return this;
@ -199,27 +189,8 @@ app.views.Help = app.views.StaticContentView.extend({
e.preventDefault();
},
chat: function(e){
this.renderStaticSection("chat", "faq_chat", this.CHAT_SUBS);
this.menuClicked(e);
e.preventDefault();
},
linkHtml: function(url, text) {
return "<a href=\"" + url + "\" target=\"_blank\">" + text + "</a>";
},
chatEnabled: function(){
return gon.appConfig.chat.enabled;
},
getChatIcons: function(){
return "<div class=\"help-chat-icons\">" +
" <i class=\"entypo-lock-open\"></i>" +
" <i class=\"entypo-chat\"></i>" +
" <i class=\"entypo-trash\"></i>" +
"</div>";
}
});
// @license-end

View file

@ -1,50 +0,0 @@
//= require emojione
//= require favico.js/favico
//= require jquery.ui/ui/resizable
//= require jquery.ui/ui/draggable
//= require jquery.slimscroll/jquery.slimscroll
//= require jquery-colorbox
//= require jquery-fullscreen-plugin
//= require diaspora_jsxc
// initialize jsxc xmpp client
$(document).ready(function() {
if (app.currentUser.authenticated()) {
$.post("/user/auth_token", null, function(data) {
if (jsxc && data['token']) {
var jid = app.currentUser.get('diaspora_id');
jsxc.init({
root: '/assets/diaspora_jsxc',
rosterAppend: 'body',
otr: {
debug: true,
SEND_WHITESPACE_TAG: true,
WHITESPACE_START_AKE: true
},
onlineHelp: "/help/chat",
priority: {
online: 1,
chat: 1
},
displayRosterMinimized: function() {
return false;
},
xmpp: {
url: $('script#jsxc').data('endpoint'),
username: jid.replace(/@.*?$/g, ''),
domain: jid.replace(/^.*?@/g, ''),
jid: jid,
password: data.token,
resource: 'diaspora-jsxc',
overwrite: true,
onlogin: true
}
});
} else {
console.error('No token found! Authenticated!?');
}
}, 'json');
}
});

View file

@ -84,8 +84,6 @@
@import 'stream';
@import 'stream_element';
@import 'comments';
@import 'diaspora_jsxc';
@import 'chat';
@import 'markdown-content';
@import 'oembed';
@import 'media-embed';

View file

@ -1,14 +0,0 @@
body > .container-fluid.chat-roster-shown {
padding-right: 224px;
#back-to-top { right: 244px; }
}
body > .container-fluid.chat-roster-hidden {
#back-to-top { right: 54px; }
}
// This element is instanciated by JSXC. Does not have to follow naming conventions
// scss-lint:disable IdSelector, SelectorFormat
#jsxc_roster {
top: $navbar-height;
}
// scss-lint:enable IdSelector, SelectorFormat

View file

@ -37,9 +37,6 @@
text-decoration: none;
margin-right: 25px;
}
#chat_privilege_toggle > .enabled {
color: $text-color-active;
}
.contacts-header-icon {
font-size: 24.5px;
line-height: 40px;

View file

@ -91,18 +91,6 @@ ul#help_nav {
border-radius: 0px 0px 4px 4px;
background-color: white;
padding: 10px 20px;
div.help-chat-icons{
text-align: center;
font-size: 50px;
line-height: 70px;
[class^="entypo-"], [class*="entypo-"] {
color: $text-color-pale;
&.entypo-chat { color: $text-color-active; }
}
}
}
}
}

View file

@ -1,6 +0,0 @@
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ add_contact_roster_q }}</h4>
</a>
<div class='answer hideable'>{{{ add_contact_roster_a }}}</div>
</div>

View file

@ -64,12 +64,6 @@
<a href="#" class="section-unselected faq-link" data-section="miscellaneous" data-items="back_to_top photo_albums subscribe_feed diaspora_app">{{ title_miscellaneous }}</a>
<span class="section-selected">{{ title_miscellaneous }}</span>
</li>
{{#if chat_enabled }}
<li>
<a href="#" class="section-unselected faq-link-chat" data-section="chat" data-items="add_contact_roster i_m_a_podmin">{{ title_chat }}</a>
<span class="section-selected">{{ title_chat }}</span>
</li>
{{/if}}
</ul>
</div>
</div>

View file

@ -162,7 +162,6 @@ class ApplicationController < ActionController::Base
def gon_set_appconfig
gon.push(appConfig: {
chat: {enabled: AppConfig.chat.enabled?},
settings: {podname: AppConfig.settings.pod_name},
map: {mapbox: {
enabled: AppConfig.map.mapbox.enabled?,

View file

@ -76,14 +76,6 @@ class AspectsController < ApplicationController
head :no_content
end
def toggle_chat_privilege
@aspect = current_user.aspects.where(:id => params[:aspect_id]).first
@aspect.chat_enabled = !@aspect.chat_enabled
@aspect.save
head :no_content
end
private
def connect_person_to_aspect(aspecting_person_id)
@ -97,6 +89,6 @@ class AspectsController < ApplicationController
end
def aspect_params
params.require(:aspect).permit(:name, :chat_enabled, :order_id)
params.require(:aspect).permit(:name, :order_id)
end
end

View file

@ -1,15 +0,0 @@
# frozen_string_literal: true
module JsxcHelper
def get_bosh_endpoint
proto = AppConfig.chat.server.bosh.proto
port = AppConfig.chat.server.bosh.port
bind = AppConfig.chat.server.bosh.bind
host = AppConfig.pod_uri.host
unless AppConfig.chat.server.bosh.proxy?
return "#{proto}://#{host}:#{port}#{bind}"
end
AppConfig.url_to bind
end
end

View file

@ -23,7 +23,6 @@ class NodeInfoPresenter
doc.services.outbound = available_services
doc.open_registrations = open_registrations?
doc.metadata["nodeName"] = name
doc.metadata["xmppChat"] = chat_enabled?
doc.metadata["camo"] = camo_config
doc.metadata["adminAccount"] = admin_account
end
@ -70,10 +69,6 @@ class NodeInfoPresenter
AppConfig.settings.enable_registrations?
end
def chat_enabled?
AppConfig.chat.enabled?
end
def camo_config
{
markdown: AppConfig.privacy.camo.proxy_markdown_images?,

View file

@ -2,6 +2,6 @@
module Export
class AspectSerializer < ActiveModel::Serializer
attributes :name, :chat_enabled
attributes :name
end
end

View file

@ -4,13 +4,6 @@
- if @aspect.contacts.size > 0 && @aspect.contacts.size < 20
= start_a_conversation_link(@aspect, @aspect.contacts.size)
-if AppConfig.chat.enabled?
= link_to aspect_toggle_chat_privilege_path(@aspect), id: "chat_privilege_toggle", class: "contacts_button", method: :put, remote: true do
-if @aspect.chat_enabled?
%i.entypo-chat.enabled.contacts-header-icon{title: t("javascripts.contacts.aspect_chat_is_enabled")}
-else
%i.entypo-chat.contacts-header-icon{title: t("javascripts.contacts.aspect_chat_is_not_enabled")}
= link_to @aspect, method: "delete", data: { confirm: t("aspects.edit.confirm_remove_aspect") }, class: "delete contacts_button", id: "delete_aspect" do
%i.entypo-trash.contacts-header-icon{title: t("delete")}
.pull-right.contact-list-search

View file

@ -2,11 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :head do
- if AppConfig.chat.enabled?
= javascript_include_tag :jsxc, id: 'jsxc',
data: { endpoint: get_bosh_endpoint }
- if current_user&.getting_started?
#welcome-to-diaspora
.container-fluid

View file

@ -1,7 +0,0 @@
If you want to encrypt your chat streams with prosody.
Add to `config/certs` your server certificate and key.
The domain name should be included in the file name e.g.:
* example.com.crt
* example.com.key

View file

@ -49,21 +49,6 @@ defaults:
unicorn_timeout: 90
embed_sidekiq_worker: false
sidekiq_workers: 1
chat:
enabled: false
server:
enabled: true
certs: "config/certs"
bosh:
proxy: false
proto: 'http'
address: '0.0.0.0'
port: 5280
bind: '/http-bind'
log:
info: 'log/prosody.log'
error: 'log/prosody.err'
debug: false
map:
mapbox:
enabled: false

View file

@ -208,68 +208,6 @@ configuration: ## Section
## increase environment.sidekiq.concurrency instead!
#sidekiq_workers: 1
## Diaspora has an internal XMPP web-client. If you want to enable the chat
## functionality or want to use a custom XMPP server, then you should edit
## the following configuration.
chat: ## Section
## Enable the chat service and all its components.
##
## Please make sure that you followed the Installation-Instructions first:
## https://wiki.diasporafoundation.org/Integration/Chat#Installation.2FUpdate
#enabled: true
## Custom XMPP server configuration goes here.
server: ## Section
## Use the configuration bridge to prosody (default=true).
## In case you want to run your own server or want to configure
## prosody on your own, you should disable it.
#enabled: false
## Set the directory in which to look for virtual hosts TLS certificates.
#certs: 'config/certs'
## XEP-0124 BOSH requests
## The easiest way of avoiding certificate and mixed-content issues
## is to use a proxy, e.g.:
##
## Apache: https://wiki.diasporafoundation.org/Integration/Chat#Apache2
## Nginx: https://wiki.diasporafoundation.org/Integration/Chat#Nginx
##
## If you configured your proxy correctly,
## you should set the proxy option to 'true'
bosh: ## Section
## If you'd like to use a proxy, you should set the proxy
## option to true, otherwise jsxc always tries to
## connect directly to the port specified below.
#proxy: true
## Configure the protocol used to access the BOSH endpoint
#proto: http
## Configure the address that prosody should listen on.
#address: '0.0.0.0'
## Configure the BOSH port.
#port: 5280
## Configure the bind endpoint.
#bind: '/http-bind'
## Specify log behaviour here.
log: ## Section
## Log file location.
#info: 'log/prosody.log'
## Error log file location.
#error: 'log/prosody.err'
## The debug level logs all XML sent and received by the server.
#debug: false
## Displays the location of a post in a map. Per default we are using the map
## tiles of the Heidelberg University (http://giscience.uni-hd.de).
## You also have the possibility to use the map tiles of https://www.mapbox.com

View file

@ -50,13 +50,4 @@ Eye.application("diaspora") do
end
end
end
with_condition(AppConfig.chat.enabled? && AppConfig.chat.server.enabled?) do
process :xmpp do
start_command "bin/bundle exec rails runner Prosody.start"
daemonize true
pid_file "tmp/pids/xmpp.pid"
stop_signals [:TERM, 10.seconds, :KILL]
end
end
end

View file

@ -1,24 +0,0 @@
# frozen_string_literal: true
if AppConfig.chat.enabled? && AppConfig.chat.server.enabled?
db = Rails.application.config
.database_configuration[Rails.env]
Prosody.update_configuration(
bosh_port: AppConfig.chat.server.bosh.port, bosh_path: AppConfig.chat.server.bosh.bind,
bosh_interface: AppConfig.chat.server.bosh.address,
log_debug: (AppConfig.chat.server.log.debug? ? "debug" : "info"),
log_info: "#{Dir.pwd}/#{AppConfig.chat.server.log.info}",
log_error: "#{Dir.pwd}/#{AppConfig.chat.server.log.error}",
certs: "#{Dir.pwd}/#{AppConfig.chat.server.certs}",
hostname: AppConfig.environment.url,
virtualhost_driver: db["adapter"],
virtualhost_database: db["database"],
virtualhost_username: db["username"],
virtualhost_password: db["password"],
virtualhost_host: db["host"]
)
end

View file

@ -29,14 +29,6 @@ SecureHeaders::Configuration.default do |config|
csp[:style_src] << asset_host
end
if AppConfig.chat.enabled?
csp[:media_src] << "data:"
unless AppConfig.chat.server.bosh.proxy?
csp[:connect_src] << "#{AppConfig.pod_uri.host}:#{AppConfig.chat.server.bosh.port}"
end
end
csp[:script_src] << "code.jquery.com" if AppConfig.privacy.jquery_cdn?
csp[:form_action] << "www.paypal.com" if AppConfig.settings.paypal_donations.enable?

View file

@ -400,11 +400,6 @@ en:
rename_aspect_a: "Click “My aspects” in the side-bar from a stream view and click the pencil icon by the aspect you want to rename, or go to your Contacts page and select the relevant aspect. Then click the edit icon next to the aspect name at the top of this page, change the name and press “Update”."
delete_aspect_q: "How do I delete an aspect?"
delete_aspect_a: "Click “My aspects” in the side-bar from a stream view and click the pencil icon by the aspect you want to delete, or go to your Contacts page and select the relevant aspect. Then click the trash icon in the top right of the page."
chat:
title: "Chat"
contacts_page: "contacts page"
add_contact_roster_q: "How do I chat with someone in diaspora*?"
add_contact_roster_a: "First, you need to enable chat for one of the aspects that person is in. To do so, go to the %{contacts_page}, select the aspect you want and click on the chat icon to enable chat for the aspect. %{toggle_privilege} You could, if you prefer, create a special aspect called “Chat” and add the people you want to chat with to that aspect. Once youve done this, open the chat interface and select the person you want to chat with."
mentions:
title: "Mentions"
what_is_a_mention_q: "What is a “mention”?"

View file

@ -121,8 +121,6 @@ en:
contacts:
add_contact: "Add contact"
aspect_chat_is_enabled: "Contacts in this aspect are able to chat with you."
aspect_chat_is_not_enabled: "Contacts in this aspect are not able to chat with you."
remove_contact: "Remove contact"
error_add: "Couldnt add <%= name %> to the aspect :("
error_remove: "Couldnt remove <%= name %> from the aspect :("

View file

@ -59,7 +59,6 @@ Rails.application.routes.draw do
get "aspects" => "streams#aspects", :as => "aspects_stream"
resources :aspects, except: %i(index new edit) do
put :toggle_chat_privilege
collection do
put "order" => :update_order
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
class RemoveChat < ActiveRecord::Migration[5.1]
def up
remove_column :aspects, :chat_enabled
drop_table :chat_contacts
drop_table :chat_fragments
drop_table :chat_offline_messages
end
end

View file

@ -66,7 +66,7 @@ class ArchiveImporter
def import_aspects
contact_groups.each do |group|
begin
user.aspects.create!(group.slice("name", "chat_enabled"))
user.aspects.create!(group.slice("name"))
rescue ActiveRecord::RecordInvalid => e
logger.warn "#{self}: #{e}"
end

View file

@ -30,8 +30,7 @@
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"chat_enabled": { "type": "boolean" }
"name": { "type": "string" }
},
"required": [
"name"

View file

@ -110,9 +110,6 @@ vars=$(bin/bundle exec ruby ./script/get_config.rb \
single_process_mode=environment.single_process_mode? \
embed_sidekiq_worker=server.embed_sidekiq_worker \
workers=server.sidekiq_workers \
chat=chat.enabled \
chat_server=chat.server.enabled \
chat_bosh_proxy=chat.server.bosh.proxy \
redis_url=environment.redis \
| grep -vE "is not writable|as your home directory temporarily"
)
@ -189,19 +186,6 @@ https://github.com/diaspora/diaspora/issues/4202 for details
"
fi
if [ "$chat" = "true" -a "$chat_server" = "true" -a "$chat_bosh_proxy" = "false" ]
then
warning "
*****************************************************************
You enabled the chat feature but haven't configured BOSH! That
could lead to mixed-content problems with the http clients. Please
think about editing your proxy configuration as described in:
diaspora.yml.example
*****************************************************************
"
fi
# Use libjemalloc if it's available for better memory usage
command -v ldconfig > /dev/null 2>&1
if [ $? -eq 0 ]; then

View file

@ -7,7 +7,6 @@
describe ContactsController, :type => :controller do
describe '#index' do
before do
AppConfig.chat.enabled = true
@aspect = bob.aspects.create(:name => "another aspect")
bob.share_with alice.person, @aspect
bob.share_with eve.person, @aspect

View file

@ -1,21 +0,0 @@
# frozen_string_literal: true
describe JsxcHelper, :type => :helper do
before do
AppConfig.chat.server.bosh.port = 1234
AppConfig.chat.server.bosh.bind = "/bind"
end
describe "#get_bosh_endpoint" do
it "using http scheme and default values" do
AppConfig.chat.server.bosh.proxy = false
expect(helper.get_bosh_endpoint).to include %Q(http://localhost:1234/bind)
end
it "using https scheme and no port" do
AppConfig.chat.server.bosh.proxy = true
allow(AppConfig).to receive(:pod_uri).and_return(Addressable::URI.parse("https://localhost/"))
expect(helper.get_bosh_endpoint).to include %Q(https://localhost/bind)
end
end
end

View file

@ -46,12 +46,10 @@ describe Diaspora::Exporter do
user: {
"contact_groups": [
{
"name": "generic",
"chat_enabled": false
"name": "generic"
},
{
"name": "Work",
"chat_enabled": false
"name": "Work"
}
]
}

View file

@ -148,8 +148,7 @@ describe MigrationService do
}
],
"contact_groups": [
{"name":"Friends","chat_enabled":true},
{"name":"Friends","chat_enabled":false}
{"name":"Friends"}
],
"post_subscriptions": [
"#{unknown_subscription_guid}",
@ -303,7 +302,6 @@ describe MigrationService do
aspect = user.aspects.find_by(name: "Friends")
expect(aspect).not_to be_nil
expect(aspect.chat_enabled).to be_truthy
poll_participation = PollParticipation.find_by(author: user.person, guid: poll_participation_entity.guid)
expect(poll_participation).not_to be_nil

View file

@ -11,29 +11,6 @@ describe("app.pages.Contacts", function(){
});
});
context('toggle chat privilege', function() {
beforeEach(function() {
this.chatToggle = $("#chat_privilege_toggle");
this.chatIcon = $("#chat_privilege_toggle i");
});
it('updates the title for the tooltip', function() {
expect(this.chatIcon.attr("data-original-title")).toBe(
Diaspora.I18n.t("contacts.aspect_chat_is_not_enabled")
);
this.chatToggle.trigger("click");
expect(this.chatIcon.attr("data-original-title")).toBe(
Diaspora.I18n.t("contacts.aspect_chat_is_enabled")
);
});
it("toggles the chat icon", function() {
expect(this.chatIcon.hasClass("enabled")).toBeFalsy();
this.chatToggle.trigger("click");
expect(this.chatIcon.hasClass("enabled")).toBeTruthy();
});
});
context('show aspect name form', function() {
beforeEach(function() {
this.button = $('#change_aspect_name');

View file

@ -1,6 +1,5 @@
describe("app.views.Help", function(){
beforeEach(function(){
gon.appConfig = {chat: {enabled: false}};
this.locale = JSON.parse(spec.readFixture("locale_en_help_json"));
Diaspora.I18n.reset();
Diaspora.I18n.load(this.locale, "en");
@ -134,30 +133,4 @@ describe("app.views.Help", function(){
});
});
});
describe("chat section", function(){
describe("chat enabled", function(){
beforeEach(function(){
gon.appConfig = {chat: {enabled: true}};
this.view = new app.views.Help();
this.view.render();
});
it('should display the chat', function(){
expect(this.view.$el.find('a[data-section=chat]').length).toBe(1);
});
});
describe("chat disabled", function(){
beforeEach(function(){
gon.appConfig = {chat: {enabled: false}};
this.view = new app.views.Help();
this.view.render();
});
it('should not display the chat', function () {
expect(this.view.$el.find('a[data-section=chat]').length).toBe(0);
});
});
});
});

View file

@ -76,7 +76,6 @@ beforeEach(function() {
// add gon defaults
window.gon = {
appConfig: {
chat: {enabled: false},
settings: {podname: "MyPod"},
map: {
mapbox: {

View file

@ -63,7 +63,6 @@ describe ArchiveImporter do
}
},
"contact_groups" => [{
"chat_enabled" => true,
"name" => "Friends"
}],
"followed_tags" => [target.tag_followings.first.tag.name],

View file

@ -39,7 +39,6 @@ describe NodeInfoPresenter do
},
"metadata" => {
"nodeName" => AppConfig.settings.pod_name,
"xmppChat" => AppConfig.chat.enabled?,
"camo" => {
"markdown" => AppConfig.privacy.camo.proxy_markdown_images?,
"opengraph" => AppConfig.privacy.camo.proxy_opengraph_thumbnails?,
@ -118,16 +117,6 @@ describe NodeInfoPresenter do
end
end
context "when chat is enabled" do
before do
AppConfig.chat.enabled = true
end
it "should mark the xmppChat metadata as true" do
expect(hash).to include "metadata" => include("xmppChat" => true)
end
end
context "when camo is enabled" do
before do
AppConfig.privacy.camo.proxy_markdown_images = true
@ -173,7 +162,6 @@ describe NodeInfoPresenter do
},
"metadata" => {
"nodeName" => AppConfig.settings.pod_name,
"xmppChat" => AppConfig.chat.enabled?,
"camo" => {
"markdown" => AppConfig.privacy.camo.proxy_markdown_images?,
"opengraph" => AppConfig.privacy.camo.proxy_opengraph_thumbnails?,

View file

@ -6,8 +6,7 @@ describe Export::AspectSerializer do
it "has aspect attributes" do
expect(serializer.attributes).to eq(
name: aspect.name,
chat_enabled: aspect.chat_enabled
name: aspect.name
)
end
end