Merge branch 'next-minor' into develop

This commit is contained in:
Benjamin Neff 2017-09-17 19:36:00 +02:00
commit 26a9e50ef9
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
743 changed files with 1528 additions and 77 deletions

View file

@ -170,10 +170,6 @@ Layout/DotPosition:
### backward compatibility
# only with ruby >= 2.3
Style/FrozenStringLiteralComment:
Enabled: false
# only with ruby >= 2.4
Performance/RegexpMatch:
Enabled: false

View file

@ -18,6 +18,8 @@
* Remove auto detection of languages with highlightjs [#7591](https://github.com/diaspora/diaspora/pull/7591)
* Move enable/disable notification icon [#7592](https://github.com/diaspora/diaspora/pull/7592)
* Use Bootstrap 3 progress-bar for polls [#7600](https://github.com/diaspora/diaspora/pull/7600)
* Enable frozen string literals [#7595](https://github.com/diaspora/diaspora/pull/7595)
* Remove `rails_admin_histories` table [#7597](https://github.com/diaspora/diaspora/pull/7597)
## Bug fixes
* Fix displaying polls with long answers [#7579](https://github.com/diaspora/diaspora/pull/7579)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem "rails", "5.1.3"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
guard :rspec, cmd: "bin/spring rspec", all_on_start: false, all_after_pass: false do
watch(/^spec\/.+_spec\.rb$/)
watch(/^lib\/(.+)\.rb$/) {|m| "spec/lib/#{m[1]}_spec.rb" }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Admin
class AdminController < ApplicationController
before_action :authenticate_user!

View file

@ -1,4 +1,6 @@
# frozen_string_literal: true
module Admin
class PodsController < AdminController
respond_to :html, :json, :mobile

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Admin
class UsersController < AdminController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class AdminsController < Admin::AdminController
include ApplicationHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class AuthorizationsController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class ClientsController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2011 nov matake
#
# Permission is hereby granted, free of charge, to any person obtaining

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2011 nov matake
#
# Permission is hereby granted, free of charge, to any person obtaining

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class TokenEndpointController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class UserApplicationsController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module OpenidConnect
class UserInfoController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module Api
module V0
class BaseController < ApplicationController

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class BlocksController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ConversationsController < ApplicationController
before_action :authenticate_user!
respond_to :html, :mobile, :json, :js

View file

@ -1,2 +1,4 @@
# frozen_string_literal: true
class HelpController < ApplicationController
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class InvitationCodesController < ApplicationController
before_action :ensure_valid_invite_code

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class NodeInfoController < ApplicationController
def jrd
render json: NodeInfo.jrd(CGI.unescape(node_info_url("123.123").sub("123.123", "%{version}")))

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ParticipationsController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class PollParticipationsController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ResharesController < ApplicationController
before_action :authenticate_user!, except: :index
respond_to :json

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class SearchController < ApplicationController
before_action :authenticate_user!

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class SocialRelayController < ApplicationController
respond_to :json

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ActivityStreamsHelper
def add_activitystreams_author(target, person)
target.author do |author|

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
@ -15,8 +17,9 @@ module ApplicationHelper
return AppConfig.settings.changelog_url.get if AppConfig.settings.changelog_url.present?
url = "https://github.com/diaspora/diaspora/blob/master/Changelog.md"
url.sub!('/master/', "/#{AppConfig.git_revision}/") if AppConfig.git_revision.present?
url
return url if AppConfig.git_revision.blank?
url.sub("/master/", "/#{AppConfig.git_revision}/")
end
def source_url

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ContactsHelper
def start_a_conversation_link(aspect, contacts_size)
conv_opts = { class: "conversation_button contacts_button"}

View file

@ -1,9 +1,10 @@
# frozen_string_literal: true
module ConversationsHelper
def conversation_class(conversation, unread_count, selected_conversation_id)
conv_class = unread_count > 0 ? "unread " : ""
if selected_conversation_id && conversation.id == selected_conversation_id
conv_class << "selected"
end
conv_class
conv_class = unread_count > 0 ? "unread" : ""
return conv_class unless selected_conversation_id && conversation.id == selected_conversation_id
"#{conv_class} selected"
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module GonHelper
def gon_load_contact(contact)
Gon.preloads[:contacts] ||= []

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module InterimStreamHackinessHelper
def commenting_disabled?(post)
return true unless user_signed_in?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module InvitationCodesHelper
def invite_hidden_tag(invite)
if invite.present?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module JsxcHelper
def get_bosh_endpoint
proto = AppConfig.chat.server.bosh.proto

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module LanguageHelper
include ApplicationHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module MetaDataHelper
include ActionView::Helpers::AssetUrlHelper
include ActionView::Helpers::TagHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module MobileHelper
def mobile_reshare_icon(post)
if (post.public? || reshare?(post)) && (user_signed_in? && post.author != current_user.person)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationsHelper
include PeopleHelper
include PostsHelper

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotifierHelper
# @param post [Post] The post object.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module OEmbedHelper
def o_embed_html(cache)
data = cache.data

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module OpenGraphHelper
def og_html(cache)
"<a href=\"#{cache.url}\" target=\"_blank\">" +

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
@ -24,11 +26,9 @@ module PeopleHelper
end
def person_link(person, opts={})
opts[:class] ||= ""
opts[:class] << " self" if defined?(user_signed_in?) && user_signed_in? && current_user.person == person
opts[:class] << " hovercardable" if defined?(user_signed_in?) && user_signed_in? && current_user.person != person
css_class = person_link_class(person, opts[:class])
remote_or_hovercard_link = Rails.application.routes.url_helpers.person_path(person).html_safe
"<a data-hovercard='#{remote_or_hovercard_link}' href='#{remote_or_hovercard_link}' class='#{opts[:class]}'>"\
"<a data-hovercard='#{remote_or_hovercard_link}' href='#{remote_or_hovercard_link}' class='#{css_class}'>"\
"#{html_escape_once(opts[:display_name] || person.name)}</a>"\
.html_safe
end
@ -44,11 +44,9 @@ module PeopleHelper
if opts[:to] == :photos
link_to person_image_tag(person, opts[:size]), person_photos_path(person)
else
opts[:class] ||= ""
opts[:class] << " self" if defined?(user_signed_in?) && user_signed_in? && current_user.person == person
opts[:class] << " hovercardable" if defined?(user_signed_in?) && user_signed_in? && current_user.person != person
css_class = person_link_class(person, opts[:class])
remote_or_hovercard_link = Rails.application.routes.url_helpers.person_path(person).html_safe
"<a href='#{remote_or_hovercard_link}' class='#{opts[:class]}' #{ ("target=" + opts[:target]) if opts[:target]}>
"<a href='#{remote_or_hovercard_link}' class='#{css_class}' #{('target=' + opts[:target]) if opts[:target]}>
#{person_image_tag(person, opts[:size])}
</a>".html_safe
end
@ -77,4 +75,14 @@ module PeopleHelper
return Rails.application.routes.url_helpers.person_path(person, opts)
end
end
private
def person_link_class(person, css_class)
return css_class unless defined?(user_signed_in?) && user_signed_in?
return "#{css_class} self" if current_user.person == person
"#{css_class} hovercardable"
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ServicesHelper
def contact_proxy(friend)
friend.contact || contact_proxy_template.dup.tap {|c| c.person = friend.person }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module SessionsHelper
def prefilled_username
uri = Addressable::URI.parse(session["user_return_to"])

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module TagsHelper
def looking_for_tag_link
return if search_query.include?('@') || normalize_tag_name(search_query).blank?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module UserApplicationsHelper
def user_application_name(app)
if app.name?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module UsersHelper
def owner_image_tag(size=nil)
person_image_tag(current_user.person, size)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
default from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>"
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class DiasporaDeviseMailer < Devise::Mailer
default from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class ExportMailer < ApplicationMailer
def export_complete_for(user)
@user = user

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Maintenance < ApplicationMailer
def account_removal_warning(user)
@user = user

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class AlsoCommented < NotificationMailers::Base
attr_accessor :comment

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Base
include Diaspora::Logging
@ -52,7 +54,7 @@ module NotificationMailers
def log_mail(recipient_id, sender_id, type)
log_string = "event=mail mail_type=#{type} recipient_id=#{recipient_id} sender_id=#{sender_id} " \
" recipient_handle=#{@recipient.diaspora_handle}"
log_string << " sender_handle=#{@sender.diaspora_handle}" if sender_id.present?
log_string = "#{log_string} sender_handle=#{@sender.diaspora_handle}" if sender_id.present?
logger.info log_string
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class CommentOnPost < NotificationMailers::Base
attr_accessor :comment

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class ConfirmEmail < NotificationMailers::Base
def set_headers

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class CsrfTokenFail < NotificationMailers::Base
def set_headers

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Liked < NotificationMailers::Base
attr_accessor :like

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Mentioned < NotificationMailers::Base
attr_accessor :post

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class MentionedInComment < NotificationMailers::Base
attr_reader :comment

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class PrivateMessage < NotificationMailers::Base
attr_accessor :message, :conversation, :participants

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class Reshared < NotificationMailers::Base
attr_accessor :reshare

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
module NotificationMailers
class StartedSharing < NotificationMailers::Base
def set_headers(*_args) # rubocop:disable Style/AccessorMethodName

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Notifier < ApplicationMailer
helper :application
helper :notifier

Some files were not shown because too many files have changed in this diff Show more