Commit graph

218 commits

Author SHA1 Message Date
Benjamin Neff
08e108d3d8
Fix comment notification subject for posts without text
Fixes #7854
2018-09-05 03:17:58 +02:00
cmrd Senya
2e0b382699
Use 'post' prefix for status message route helpers
This is required to make url_for(StatusMessage.new) work
2018-07-11 01:24:28 +02:00
Benjamin Neff
beeb073dbe
Fix followed tags posts in stream for posts with multiple tags
When there were posts with many followed tags they were returned
multiple times, resulting in less than 15 unique posts. That resulted in
some posts to be missed in the stream.

Fixes #4503

closes #7715
2018-02-25 04:35:49 +01:00
Benjamin Neff
c82e891c03
Add reference source and target behaviour 2017-09-28 23:04:34 +02:00
Benjamin Neff
655fe2a912
Cleanup invalid polls without status message
closes #7614
2017-09-18 03:24:52 +02:00
Benjamin Neff
e82690963d
Add # frozen_string_literal: true to all files 2017-09-17 19:29:15 +02:00
cmrd Senya
fca6121c6a
Exporter::PostsWithActivity class
This class allows to query posts where a person made any activity (submitted comments,
likes, participations or poll participations).
2017-08-09 18:09:04 +03:00
cmrd Senya
1fb6040344
new PostController#mentionable_in_comment action 2017-01-13 04:47:50 +02:00
cmrd Senya
33ad411bbd
Mentions in comments backend changes 2016-11-28 15:56:56 +02:00
Benjamin Neff
3f2586bc6f
Create share visibilities for photos attached to a private post
Also fixed the "fix public photos"-migration, because it didn't work
with migration-models :/

fixes #6177
2016-09-20 04:24:37 +02:00
Benjamin Neff
fb318373c7 only create mentions after creating statusmessages 2016-08-17 02:26:58 +02:00
Benjamin Neff
d72727f4ac remove unused absence_of_content check
this didn't do anything
2016-07-17 01:40:00 +02:00
Benjamin Neff
2cd831f94e also validate remote posts
all data is included in the federated status_message, so we can validate
on receive. add the photos to the status_message before save.
2016-07-17 01:40:00 +02:00
Benjamin Neff
df9874b73a remove raw_message
This was only an alias for "text", and "raw_message" is also not used
for federation anymore, so we can drop it.
2016-07-17 01:40:00 +02:00
cmrd Senya
026f577bfd
Remove unused methods 2016-07-08 21:30:41 +03:00
Steffen van Bergerem
46cbc6e52a
Filter mentions on status message creation 2016-07-04 10:26:45 +02:00
Jonne Haß
09908a45fb
StatusMessage#raw_message returns empty string for NULL values
Previously the federation layer has written the empty string to the
database, now it writes nil/no value to it while our code still expects
the empty string in some cases. Restore the old assumption by returning
the empty string, the real raw value by now is available again in
StatusMessage#text for those that need it, such as validations or tests.
2016-06-27 12:07:11 +02:00
Benjamin Neff
21fd9f23da remove roxml 2016-06-26 06:21:01 +02:00
Benjamin Neff
7184d4334e remove after_dispatch hook
handle photos in StatusMessageCreationService
2016-06-26 06:21:00 +02:00
zaziemo
f92a2ee0dd merge address & coordinates in one location object
to provide a clear arrangement of all location data
- add 'L' to predefs for pronto because it is part of the leaflet library
- fix: show address template only with an address present
with merging the location objects into one, only the objects within
the location object can be empty
(#5813)
2015-09-09 12:22:48 +02:00
zaziemo
298e195a8f add a map subview
- add coordinates in post_presenter
- add map to the SPV if location is provided
- add leaflet.js to render map and marker of position
- make coordinates available in frontend
- add map scss
- make stream post location clickable and redirect to the SPV
- prevent render map if no location data is provided
- add tests for coordinates
- use the leaflet gem instead of the JS assets
(#5813)
2015-09-09 12:19:38 +02:00
Benjamin Neff
ed10bea21f don't dispatch photos twice ... 2015-06-08 04:15:17 +02:00
Steffen van Bergerem
1b77258d0e Set default for post title truncation to 70 characters
closes #6022
2015-06-02 12:14:35 +02:00
Benjamin Neff
986ad0df14 fix validation for status-message when the author is missing
closes #5986
2015-05-24 11:16:05 +02:00
Augier
2ce98b49d7 Fix issue #4416
Conflicts:
	spec/helpers/notifier_helper_spec.rb
2014-10-16 23:27:48 +02:00
Jonne Haß
01e0127287 Ignore embedded photos if invalid
For example if they're already present
Also refactor StatusMessage XML specs
2014-09-06 04:52:18 +02:00
khall
a9fd16db3e Fix for issue 5090: Changing error message wording and providing more information to user when status message is too long. 2014-08-24 13:28:57 -07:00
Jonne Haß
cb13d30a02 Directly query photos when doing an update_all
For some reason it doesn't correctly set the bind variables
when called through an association with non-standard
keys. Probably a Rails bug.
2014-08-23 16:38:57 +02:00
Jonne Haß
a9e107364a make status message controller spec pass and deprecation free 2014-08-23 16:34:00 +02:00
Jonne Haß
89afb616cf replace deprecated scope syntax and unify it 2014-08-23 16:34:00 +02:00
Jonne Haß
33c3b38f2f replace deprecated finder and finder_options syntax 2014-08-23 16:34:00 +02:00
Jason Robinson
356096a7eb Merge pull request #4836 from MrZYX/message_renderer
Introduce message renderer
2014-04-13 15:00:46 +03:00
Jannik Streek
04199837b3 poll creation done 2014-03-31 18:14:07 +02:00
Jannik Streek
fe67bdf2e7 added tests for poll federation and impl for the federation itself. Still in progess 2014-03-31 18:14:06 +02:00
Jannik Streek
dfbe17d046 Poll input fields and data model now available
question field of poll now in db

fixed merge issues
2014-03-31 18:14:06 +02:00
Jonne Haß
8280556a47 Introduce message renderer
This new class replaces all existing server side message
rendering helpers and is the new global entry point for such
needs. All models with relevant fields now expose an instance
of MessageRenderer for those. MessageRenderer acts as
gateway between the existing processing solutions for markdown,
mentions and tags and provides a very flexible interface for
all output needs. This makes the API to obtain a message
in a certain format clear. As a result of centralizing the
processing a lot of duplication is eliminated. Centralizing
the message processing also makes it clear where to change
its behaviour, add new representations and what options
are already available.
2014-03-15 17:16:17 +01:00
Ivan Zotov
a4ce6e267a Fix after_create to after_commit 2014-01-14 22:35:29 +04:00
Florian Staudacher
e614562470 avoid publishing empty posts (fixes #4401)
invalidate empty posts when created by a local user

add changelog entry
2013-09-24 21:57:22 +02:00
Fábián Tamás László
ba3d60b00f Only parse opengraph if oembed is not available 2013-08-04 15:55:09 +02:00
Tamas Laszlo Fabian
3cead93dbc Load og data faster (after_save -> after_commit) 2013-08-04 15:46:44 +02:00
Fábián Tamás László
176c6826e0 opengraph POC
Fixed small-frame opengraph view

Fixed incompletely saved OpenGraphCache bug
2013-08-04 15:42:29 +02:00
James Fleming
66a07bd938 Remove attributes protection.
Use a blacklist approach instead of a blacklist approach in Profile#receive.

Remove attr_accessible from models and make specs pass.
2013-08-02 11:39:06 +02:00
Florian Staudacher
4ee5d5f19c replace mentions of out-of-aspect people in limited posts with just a
markdown link to their profile (fixes #2516)

add failing spec for #4160 / #2516

extend the spec a bit more

refactor mention handling in a status message

add method for filtering mentions by aspects

wire mention filtering into the status message model, adapt a few tests to
work properly

cosmetic changes

shorten helper methods

add changelog entry
2013-06-09 19:16:40 +02:00
Jonne Haß
286e948054 federate location 2013-05-20 21:26:04 +02:00
Marco Gallardo
4aab8762fa Locator feature
added marker image for publisher, showing div for address, and added
functionality to close it when clicking 'X' image

showing marker image in publisher

renamed map-marker to locator

fixed style for map marker image in publisher

added locator.js to get user's location

loading google maps api

removed unecessary append and showing location next to publisher

moved location address inside div and  added image to close location

styled div location address an image to close location

removing location when clicking close image

cleaned code

cleaned code

showing loader while location is being obtained, translated normal js to
backbone structure, created locations db stuff, and removing location
div when clicking 'share'

refactored code; started to move code to backbone

refactored js code; moving functionality to backbone structure

created address function to make accessible address variable value

refactored locator.js

showing and removing location div from dom

created location; it belongs_to status_message

added location model and created association with status_message

added hidden field for location address and added respective code on js files to retrieve it on ajax call

saving location for status_message (post)

removing location when sharing

renamed locator backbone view to location, added template, showing
location, and saving lat and lng

prepared and added template to show location

added location to post model in order to have it accessible in backbone

retrieving location to show it in template

removed console.log XD

fixes when removing location

cleanind location_address hidden field when location is removed

more fixes; showing location when sharing

saving location just when it exists

created method to retrieve location address just when location was created

fixed issue about showing 'Near from' message when there was not any location

added style for location

cleaned code

renamed locator view

retrieving lat and lng from locator.js

saving lat and lng in location_coords

saving lat and lng

added style for input location_address

removed location_address  hidden field; the value will be taken directly from input with the location

replaced div with location for input; the user will be able to edit the place

avoiding submitting the form when pressing Enter key on new input for location

added missed spec file for location model

refactored location_view code

refactored location_view code

cleaned code

added sinon library for testing

added describes for new publisher's view functions

created test for destroyLocation function

added test for showLocation publisher view function

created test for avoidEnter publisher view function

removed unnecessary div

Created first test for locations view, added more specs, added Sinon.js,
and fixed issue with assets

loading locator.js for tests

moved location stuff to app/assets

moved locator.js and sinon.js to app/assets

fixed route for images

included locator.js to assets

fixed issue when post object is different than StatusMessage; also fixed issue with lat and lng

loading Sinon for specs

refactoring locator errorGettingposition and start replacing google maps stuff with OSM

added OpenLayers JS, osmlocator, and added them into the main js

changing the locator from Google to OSM instance

changing lat and lng value in the backbone view

removing google javascript tag in application layout

adding jasmine to locator test and removed locator.js

adding jasmine to locator test using OSM

adding Jasmine test to OSM locator

removed locator.js

removed require locator and updated schema

fixed js response; added location

since we are using OSM Locator we don't need locator-spec test

fixed spec for location view; we are not using google maps anymore

changed description of osmlocator-spec

fixed issue with status-message-location template

fixed style for location_address textbox

fixed tests for locator

moved split function to model

created test for location model

removed puts

added effect for location marker

added translations for locator

removed conflicting-unnecessary lines that were loading files for specs

removed sinon library; using sinon-rails gem

removed useless code

removed puts; added Rails.logger.error

added sinon.js file

added specific version of sinon-rails gem

improving validations sintax

using openlayers-rails gem

removed 'google API' text

using sinon gem

isolating LocationStream view

refactored validation

getting location when post is a Reshare

refactored code

fixed aligment for elements under location message

improved styling for location message

refactored begin-rescue block

getting absolute root instead of just the root

added address method to retrive address of location

removed code from Post model; also added descriptinon why it was removed

removed validation when retrieving address; with latest refactorizations we dont need them any more

interpolated location; using file in locales

fixed width for div of location

moved Sinon gem into development and test group

fixed method's description

added missed indexes

updated schema with locations table

removed openlayers-rails gem

preventing location to be saved if there are not coordinates

fixed spec; wrong closing tag
2013-05-02 17:31:53 -05:00
Jonne Haß
322f4da4d8 Embed associated photos into the status message xml 2013-04-21 19:44:09 +02:00
Jonne Haß
79a79d65d6 Bye Resque. Ohai Sidekiq.
* Dropped all references to Resque
* Moved all jobs under app/workers since that's the Sidekiq convention
* Renamed Jobs module to Worker to match new location
* Adapted all jobs to Sidekiq
* Replaced all enqueue calls with perform_async
* Dropped Resque hacks from specs and features, replaced with
  sidekig/testing in RSpec and sidekig/testing/inline in Cucumber
* Updated scripts to start a Sidekiq server
* Inline Sidekiq sinatra app
* Let Sidekiq create the actual Redis instance
* Workaround already initialized constant warnings in service models
* Resolved ToDo in one job definition by creating proper exception clases
  for some errors in receiving posts
* Added sidekiq section to configuration to make it completly
  configurable to the user
* Add Sidekiq middleware for clean backtraces
* Delay HttpMulti retry to give offline pods a chance to come back up
* Do not retry on GUID already taken and alike errors
* Be graceful about deleted posts in GatherOEmbedData
2013-03-21 23:39:07 +01:00
Jonne Haß
3fc3b249e7 End the require mess
* Rename and reorganize post fetcher to fix autoloading, also let it use
  Faradays default connection so we get nice redirects
* Add initializer to load libs at a central place
* added lib dir to autoload_once paths to increase thread safety
* Moved lib/exceptions.rb to lib/diaspora/ to conform namespacing
2013-03-21 23:37:53 +01:00
Fabián Rodríguez
4fa04e88ac don't join the tags table here, it makes the query slower 2013-01-28 18:57:26 -02:00
Jonne Haß
e70e48d6ca some refactoring regarding the law of demeter 2012-09-23 19:33:19 +02:00