diff --git a/.gitignore b/.gitignore index 9947f3f6576..e4121e00ea7 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,10 @@ spec/fixtures/*.y*ml spec/fixtures/*.fixture.* coverage/* +#Documentation +.yardoc/ +doc/ + # Uploaded files and local files public/uploads/* public/assets/* diff --git a/.yardoc/checksums b/.yardoc/checksums deleted file mode 100644 index fa9d256c4de..00000000000 --- a/.yardoc/checksums +++ /dev/null @@ -1,144 +0,0 @@ -app/models/jobs/process_photo.rb 07bf353232233eabbeeac1410d971630420e2e24 -app/models/conversation_visibility.rb c3c3f3ea3cbf8f9ce75821eb99edccab068ae816 -app/models/notifications/request_accepted.rb 17bf0a5bde9fa1172392a0bf981e7e926418231f -app/helpers/aspects_helper.rb 8bf0e66d7d304e01b6e49cdc68b8afc5b61e1e25 -app/models/jobs/mail_mentioned.rb e468499ccc0bbefde48e4824dc3d8cdd8a272b26 -lib/diaspora/user.rb 2bfd74896a7a0846d69a35b656e3fc71ae59a164 -app/controllers/comments_controller.rb d9483663a26d6d5966eabe8ca5c924ac2312592c -app/models/like.rb e3ad7863591358109b7f4e5bfa53bd87759b42b1 -app/models/jobs/mail_comment_on_post.rb 86b2b719a7bdbe45d6c7106c83b73ce663213533 -app/models/jobs/mail_started_sharing.rb 3bf07022266acbd487ba7ae57f5ea6bef1564f14 -app/helpers/language_helper.rb 7499b66eef413a4edc41bfc7aa11e10a5f98734d -lib/fake.rb 55d535ce2bfaef8ca63c6f92a959f543866c67af -app/models/jobs/receive_salmon.rb 778b38c4c38d8cc0338b298466b880478cba7d3b -lib/hcard.rb 9afd5c6c628f3d6ab05114be01ca93fcbcddc3a0 -lib/diaspora/guid.rb 0831c36a234e4a67b041a5bcb0ef0c0b8fcaeb3e -lib/webfinger.rb 2b41dbed8d2304f66793281886f847b5641a3e39 -lib/collect_user_photos.rb 9850815c569d450f93c37af2b5af2ac395aa7566 -app/controllers/invitations_controller.rb ceed71a32e35a980ae74c5d8dea46c2ffe8effdd -app/models/comment.rb 2b3400756f3dfae2b217c14c141f01e5d97e639e -app/controllers/tags_controller.rb 58c67c894f053908bdc24be53c6ab4eec27611f9 -app/models/user.rb 08ffea5fc5044e8baad97dc055f5cf2352b99a10 -app/models/notifications/liked.rb d38ed71e1638a6d2e1f339b21d47f02619bf596b -app/controllers/tokens_controller.rb a810569f631fb8feadd53a7d8862fa078563f8a5 -app/models/notifications/also_commented.rb b9c1dc5cd1a333f5983d9dd9e995f1ec7b7afaf8 -app/models/service_user.rb fbb47f76a189e11d23664e691c732ecee14454a1 -app/controllers/messages_controller.rb 8400298e3a5bf49234092e3729dfb246c10d61e6 -lib/development_mail_interceptor.rb 129f13c43f0c4bcd273312000ab2befbc91a60ab -app/models/post.rb 4f8b6ee1c04e72539ed26f12b6aa56b140d4853e -app/models/aspect_visibility.rb 3edc84d7f2b88a21f6455617d76f613524d7c8c4 -lib/diaspora/user/querying.rb ae17ed4bde5597b68ad006e883e946355d81da69 -app/helpers/layout_helper.rb 9ea5941a1b6c88687018dbc13a8696d31995c60b -lib/splunk_logging.rb 47f9b5db8b32c6da921d360992c976770e04098f -lib/chrome_frame.rb bfa3a5d0e60edf00716724f8e41682fe80040d1c -app/controllers/aspects_controller.rb a1d388f76b63ceeb7a6bfca489180a3c8d8147d5 -app/helpers/markdownify_helper.rb 144de1c8e41cd9ea62b9f2bfd5e01d3e270db2b7 -app/helpers/publics_helper.rb 391ae86656d7542f99057baf4e54384e98fc5976 -lib/rake_helpers.rb 6dcf44ace70c72350ed647e35a97ce89fd90f975 -lib/diaspora/encryptable.rb 1546637e5d086c1d8c53214a94be9387cc6ab50d -app/mailers/notifier.rb 1a98e17916d3a63b1cee8cd2c13174e303521157 -lib/diaspora/parser.rb cfb7f7f797b43fa57ae507527f32fc96801dda1c -app/models/request.rb 6ba9fafc1eed807fc9bb70f1eb80c44485c78128 -lib/diaspora.rb 404e72b8e03cf9a3bb1dd97540375608f1b26edc -app/models/user_preference.rb 3f38fcd2f1da6292f2877f1598126eb50f793af5 -app/controllers/likes_controller.rb 4079f53539ab9ff24b7509d431cbdba8bf2f5742 -app/uploaders/unprocessed_image.rb 55a574a606795c76d86c0dcb4007fc2e9caeed98 -app/helpers/status_messages_helper.rb 82fa934ff00a6a00af03e7ba0258c829661f7be3 -app/controllers/services_controller.rb 03369201b2ce5ae7113adc7b375a8ecc5b0edd35 -app/models/jobs/mail_liked.rb f9575abef93b17f37b7368c0037b500c5b965dc9 -app/controllers/apis_controller.rb 6197b2ba581f8ec5cb08f2ba8a71e99b333c6a67 -app/helpers/application_helper.rb f660726b7bf19d2e39138219fdc734d31ee418c2 -app/controllers/posts_controller.rb 37900577192f332cbbe8fd49f6fe9142e8e0f32c -app/helpers/error_messages_helper.rb 9062b5b36b2df5d97a4afc67274512bea3bd746b -app/controllers/status_messages_controller.rb 9db3bd7c597a8b42eda4d81afd22f4043df8d1b2 -app/models/jobs/receive.rb 49b602779318ad7b41e6c12c082d651c7661e2c5 -app/models/profile.rb 6a151c0f31bcbdc6207cad3ad090e6eac982283a -app/models/activity_streams/photo.rb b8e9ce3c1bde805ce064454db213e377c8b4392b -app/models/relayable_retraction.rb 7521197d0ba57495f431af93bf0dff1b9b3636c2 -app/helpers/stream_helper.rb 1e3d0f97465b581cb9f0499207d89c06d0b4d69f -app/models/aspect.rb c335d5779cf6e077efe625c679bada8af4e1230c -app/controllers/conversation_visibilities_controller.rb fd91f231add57aeba7384527d2276f7370194562 -app/models/jobs/base.rb 3124c3c0624f5a0ab223415ce09e3ab4a76e0759 -lib/diaspora/web_socket.rb a36225354db4e3715369935ef57e66c293d92d1c -lib/diaspora/user/connecting.rb 6f81cdfcd461e5b7b448399ebce7e00fac148a18 -app/models/invitation.rb d4ea320bd3dc3772c788aafa90b7982deb59e3fd -app/models/notifications/started_sharing.rb 583e1ccb9ed908e07ffc4a0f6dc43bed3878255a -app/helpers/aspect_global_helper.rb 9a4e6228057af7b1131f688c3bdc11294a2098be -lib/youtube_titles.rb e8b728d8f2a39b8df271130b795a898983c30573 -app/models/jobs/receive_local_batch.rb 883d9546eac5a0b212102a44711d4970e8b7e96d -app/controllers/post_visibilities_controller.rb 7a52e9a7185548f2bd3ec377b97d7b8b387326bb -app/controllers/admins_controller.rb e9bbfecb0a2f636830acefa59995678df6341869 -app/controllers/people_controller.rb 7563bc524a08fe294a94b02865ad7e9e0a51ae69 -app/helpers/sockets_helper.rb 4d98677751262dc2d52315b1cd80832c5c1d53e9 -app/models/message.rb cd9162d6cac3df3b25a164d4aea9f6de4e617c1f -app/models/jobs/http_multi.rb 20e960fa80a3a5fa7306364d5ab93a811767d913 -lib/webfinger_profile.rb 37dca32719312bc3d3a47b58eb0fa1716081b577 -app/controllers/publics_controller.rb c6f444d66aa2422e9a73e0e9e670b2276a322ef6 -lib/encryptor.rb 90365ba2ec1051d050273181d57f8583dae96ff4 -app/controllers/sockets_controller.rb 676e60737df103f9653afc050b2ad97540cdb033 -app/controllers/application_controller.rb 2d65af8fef391b50280286daffca6f608cea7ed6 -lib/postzord.rb 91155a42f013f68cad3fe44037d97766c4459e46 -app/models/notification_actor.rb 5b6fe651b341e3c2c1d56e1fc55fa74ac09c7d05 -app/models/jobs/mail_private_message.rb d28db317cf4738d1036284b329e8fee13f9534cb -app/controllers/users_controller.rb 69840f7d491bdc507e648884739543ae8f41eea3 -app/models/services/twitter.rb 3db64d3870e8960ed826663d3b21670a6ab1302a -app/helpers/users_helper.rb bdab0e9c1f2158460a0426e5d260a331cf7acde3 -app/models/mention.rb ecdb144f9213cdd9e81972fc603c5db0da6e6ee6 -app/models/person.rb 8facc2c7e56c95c14151978032fc9bcf5794496e -lib/diaspora/webhooks.rb abd3613c592790c2c375c91d36e8af82eb7492bf -app/models/jobs/delete_account.rb 712442380ddb73761b235908e33d5fa0ac681753 -app/models/notifications/mentioned.rb 9f15f72210a305d08d480670f3833d6c6a03188f -app/models/conversation.rb 5886762a03434f2c9fc744f25c12cc397c489a59 -app/controllers/profiles_controller.rb 2c439988db06ac4dee45e6e72cdf5d24abc51528 -app/helpers/likes_helper.rb d0c91fba653ae44ee4bd9862cbc0d6221cc64ae9 -app/helpers/mobile_helper.rb d146b4d30af80e370df75c5454a823c981ae73de -lib/direction_detector.rb 80ae6454c9d11cc8cfe76d7f3d4f65d903562a62 -app/models/aspect_membership.rb c9195f714c5a51555b180e50b13bdabc73f8b716 -lib/pubsubhubbub.rb 17ceaa27d14b1cac0b40dff0a5ceebc332dc1b5d -lib/postzord/receiver.rb c38b6bd8a6389210b7e5ea7a611014b07b505149 -app/controllers/photos_controller.rb 853274a36afb4a8232b2dc1eb20b7a2dcbaa10f8 -app/models/notifications/comment_on_post.rb 00c05f15683458ae8b37023c51f9f7bbea28bfa4 -lib/cruise/build.rb 82ff59377ba3ad2a11e9a52940ebb1aac2ffea52 -app/helpers/people_helper.rb 0350106a67127dbb05231d6880d5517399de96e3 -app/models/jobs/post_to_service.rb 406fcf6091c07bd59d06db1b015336f50b165f87 -lib/diaspora/exporter.rb dc61617c690ff6b8f6e9474a7c73810c1075c58b -app/models/status_message.rb f623f4f969e02a9ec089205ba88f442e486ca521 -app/models/contact.rb f16d247b6ec0c4497e3ba90a1b0a4ff4eb4db814 -app/uploaders/processed_image.rb c16375b00e6589505ed48fab14c0291bca19342d -app/controllers/aspect_memberships_controller.rb c09c52883c63951c7af4bd52cedae134ae7ee344 -lib/log_overrider.rb 8efa54a42e32b2493cbec0d6f622da54c1d76e57 -app/models/jobs/resend_invitation.rb 955d43f984d42d6a49c3a270ef0e22ae6baff8b7 -app/models/notifications/private_message.rb 423dd184873141fbf65320026772f9c2a6763f2c -app/controllers/sessions_controller.rb 3435dafb115375e406e71f0b1abc527ccb6744ca -app/models/notification.rb e63f02dedc4828606b58668c9a1cf2f6cc04ceb5 -app/models/services/tumblr.rb cf17a8c6935ed1c2817d312b73b7cd5040124261 -app/controllers/notifications_controller.rb c0d117950c8578b6f3d2f303bb8d93e9b22b90b9 -app/controllers/registrations_controller.rb 9f1c6bb886cafcb17e3e85bafe238c1004007f16 -app/models/jobs/update_service_users.rb 87d8fb174d9a3f2402b76dff098af30c9e62c6bb -app/controllers/contacts_controller.rb 6e51e74f08eb8d476d0252ff68b8aa9c0d6a7847 -app/helpers/comments_helper.rb e4bb2ef4b1d4abba48c792f4f2ae245d8b958a8b -app/models/jobs/notify_local_users.rb f1a552240566e61912b276d964ce907fcb97c5d0 -lib/diaspora/relayable.rb ffef93646ef927ce597441c51ecdc0246a721fbf -lib/diaspora/ostatus_builder.rb e19d782a0f9776a1758f87dd17c5d589e176a9e1 -app/models/jobs/socket_webfinger.rb 4c3a50bff8c51007108dcb4ffd277a1f20b05a36 -app/models/services/facebook.rb 289d3f2c968bb9d4d6a4183b4fd71816d7e2b680 -lib/postzord/dispatch.rb 1dab04be068e01ae73de632f358660ee156dfb75 -app/models/app_config.rb 89900ef69a85706b353a8d34ed9d6aef90d20713 -app/helpers/tags_helper.rb 6ffe96fd4d7da104244cd58801e7e4b4c16a7c4a -app/controllers/conversations_controller.rb 8a335ecf35080fca8c13eaa84178f7cf32dd46cf -app/models/jobs/invite_user_by_email.rb 0620f53733c346b7a7bc7d01f6dcc9d5ab10c562 -lib/salmon/salmon.rb 879c2ee468b9118c22792f73aef13b867c7002b5 -app/models/post_visibility.rb f6d320b1c4b35c9307e59b1e37cf46bd855375fd -app/models/photo.rb 98ec70c45f51445f00f667a843c0d4e82baa97fa -app/models/retraction.rb 3265e0ac2cf98081a49d80377473a0c299480b7a -app/models/jobs/mail_also_commented.rb 105042cfa879bcd1de321e560e2145e0f27cd52c -lib/resque_job_logging.rb 1df39084b3fdfd73c73537855a7388bd8ab8ac29 -app/controllers/activity_streams/photos_controller.rb ab58bb90489997f7fee6ffe40330729ab40dc741 -app/models/jobs/http_post.rb 2560c6b08be06020c87bf60e4be63add4073a48a -lib/active_record_instantiation_logs.rb d9e1817a755b39e4fa7f9c54f2e4c26882855721 -app/models/jobs/publish_to_hub.rb bdd97083b596c30e08b24689e78c85322b875204 -app/models/service.rb ab3c000da614959247b924d6dc0c91f7e7439336 -app/controllers/home_controller.rb d2e3453c670f71f1c51e7863b7b8c061c3abaca1 -lib/diaspora/taggable.rb 7e82aa7a9f7460568aca6f911e42289d6332c6e8 -app/controllers/apps_controller.rb 447d557f9cc265de6ee672d1ef01fba060f0d2cd -app/helpers/notifications_helper.rb 93cdba1161e88b83fad57b68892af216164588d7 diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat deleted file mode 100644 index 494d8bd5a7d..00000000000 Binary files a/.yardoc/objects/root.dat and /dev/null differ diff --git a/.yardoc/proxy_types b/.yardoc/proxy_types deleted file mode 100644 index ff011162a4c..00000000000 Binary files a/.yardoc/proxy_types and /dev/null differ diff --git a/doc/ActionController/LogSubscriber.html b/doc/ActionController/LogSubscriber.html deleted file mode 100644 index 22a1afe51df..00000000000 --- a/doc/ActionController/LogSubscriber.html +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - Class: ActionController::LogSubscriber - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ActionController::LogSubscriber - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - -
Includes:
-
Oink::InstanceTypeCounter
- - - - - -
Defined in:
-
lib/log_overrider.rb
- -
-
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Oink::InstanceTypeCounter

-

#before_report_active_record_count, included, #report_hash, #report_hash!, #report_instance_type_count

- - -
-

Instance Method Details

- - -
-

- - - (Object) process_action(event) - - - -

- - - - -
-
-
-
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-
-
# File 'lib/log_overrider.rb', line 43
-
-def process_action(event)
-  payload   = event.payload
-  additions = ActionController::Base.log_process_action(payload)
-  params  = payload[:params].except(*INTERNAL_PARAMS)
-
-  log_hash = {:event => :request_completed,
-              :status => payload[:status],
-              :controller => payload[:controller],
-              :action => payload[:action],
-              :format => payload[:formats].first.to_s.upcase,
-              :ms => ("%.0f" % event.duration).to_i,
-              :params => params.inspect}
-  log_hash.merge!({
-              :gc_ms => GC.time/1000,
-              :gc_collections => GC.collections,
-              :gc_bytes=> GC.growth}) if GC.respond_to?(:enable_stats)
-
-  log_hash.merge!({:view_ms => payload[:view_runtime],
-                   :db_ms => payload[:db_runtime]}) unless additions.blank?
-  log_hash.merge!(report_hash!)
-
-  Rails.logger.info(log_hash)
-end
-
-
-
- -
-

- - - (Object) start_processing(event) - - - -

- - - - -
-
-
-
-39
-40
-41
-
-
# File 'lib/log_overrider.rb', line 39
-
-def start_processing(event)
-  #noop
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/ActionDispatch.html b/doc/ActionDispatch.html deleted file mode 100644 index b45083144f4..00000000000 --- a/doc/ActionDispatch.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - Module: ActionDispatch - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: ActionDispatch - - - -

- -
- - - - - - - - -
Defined in:
-
lib/log_overrider.rb
- -
-
- -

Defined Under Namespace

-

- - - - - Classes: ShowExceptions - - -

- - - - - - - -
- - - - - \ No newline at end of file diff --git a/doc/ActionView/LogSubscriber.html b/doc/ActionView/LogSubscriber.html deleted file mode 100644 index dc5b0c2e82e..00000000000 --- a/doc/ActionView/LogSubscriber.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - Class: ActionView::LogSubscriber - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ActionView::LogSubscriber - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
lib/log_overrider.rb
- -
-
- - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) render_template(event) - - - - Also known as: - render_partial, render_collection - - -

- - - - -
-
-
-
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-
-
# File 'lib/log_overrider.rb', line 2
-
-def render_template(event)
-  count = event.payload[:count] || 1
-  hash = {:event    => :render,
-          :template => from_rails_root(event.payload[:identifier]),
-          :total_ms => event.duration,
-          :count    => count,
-          :ms       => event.duration / count}
-
-  hash.merge(:layout => event.payload[:layout]) if event.payload[:layout]
-
-  Rails.logger.info(hash)
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/ActiveRecord/LogSubscriber.html b/doc/ActiveRecord/LogSubscriber.html deleted file mode 100644 index 8932fd0ec70..00000000000 --- a/doc/ActiveRecord/LogSubscriber.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - Class: ActiveRecord::LogSubscriber - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ActiveRecord::LogSubscriber - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
lib/log_overrider.rb
- -
-
- - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) sql(event) - - - -

- - - - -
-
-
-
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-
-
# File 'lib/log_overrider.rb', line 83
-
-def sql(event)
-  self.class.runtime += event.duration
-  return unless logger.info?
-
-  payload = event.payload
-  sql     = payload[:sql].squeeze(' ')
-  binds   = nil
-
-  unless (payload[:binds] || []).empty?
-    binds = "  " + payload[:binds].map { |col,v|
-      [col.name, v]
-    }.inspect
-  end
-
-  log_string = "event=sql name='#{payload[:name]}' ms=#{event.duration} query='#{sql}'"
-  log_string << "caller_hash=#{caller.hash} binds='#{binds}' caller_with_diaspora='#{caller.grep(/diaspora\/(app|lib)/).join(';')}'"
-  info log_string
-
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/AppConfig.html b/doc/AppConfig.html deleted file mode 100644 index 3158b80cd7f..00000000000 --- a/doc/AppConfig.html +++ /dev/null @@ -1,914 +0,0 @@ - - - - - - Class: AppConfig - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: AppConfig - - - -

- -
- -
Inherits:
-
- Settingslogic - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/app_config.rb
- -
-
- - - - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - - -
-

Class Method Details

- - -
-

- - + (Object) [](key) - - - -

- - - - -
-
-
-
-103
-104
-105
-106
-
-
# File 'app/models/app_config.rb', line 103
-
-def self.[] (key)
-  return self.pod_uri if key == :pod_uri
-  super
-end
-
-
-
- -
-

- - + (Object) []=(key, value) - - - -

- - - - -
-
-
-
-108
-109
-110
-111
-112
-113
-114
-
-
# File 'app/models/app_config.rb', line 108
-
-def self.[]= (key, value)
-  super
-  if key.to_sym == :pod_url
-    @@pod_uri = nil
-    normalize_pod_url
-  end
-end
-
-
-
- -
-

- - + (Boolean) config_file_is_old_style? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-71
-72
-73
-
-
# File 'app/models/app_config.rb', line 71
-
-def self.config_file_is_old_style?
-  !(File.read(@source) =~ /^defaults: &defaults/)
-end
-
-
-
- -
-

- - + (Boolean) have_old_config_file? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-83
-84
-85
-
-
# File 'app/models/app_config.rb', line 83
-
-def self.have_old_config_file?
-  File.exists?(File.join(Rails.root, "config", "app.yml")) || (File.exists?(File.join(Rails.root, "config", "app_config.yml")))
-end
-
-
-
- -
-

- - + (Object) load! - - - -

- - - - -
-
-
-
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-
-
# File 'app/models/app_config.rb', line 21
-
-def self.load!
-  if no_config_file? && !have_old_config_file? && !travis?
-    $stderr.puts "******** You haven't set up your Diaspora settings file. **********\nPlease do the following:\n1. Copy config/application.yml.example to config/application.yml.\n2. Have a look at the settings in that file. It has sensible defaults for development, which (we hope)\nwork without modification. However, it's always good to know what's available to change later.\n3. Restart Diaspora!\n******** Thanks for being an alpha tester! **********\n"
-    Process.exit(1)
-  end
-
-  if (no_config_file? && have_old_config_file?) || config_file_is_old_style?
-    $stderr.puts "******** The Diaspora configuration file format has changed. **********\nPlease do the following:\n1. Copy config/application.yml.example to config/application.yml.\n2. Make any changes in config/application.yml that you previously made in config/app.yml or config/app_config.yml.\n3. Delete config/app.yml and config/app_config.yml. Don't worry if they don't exist, though.\n4. Restart Diaspora!\n******** Thanks for being an alpha tester! **********\n"
-    Process.exit(1)
-  end
-
-  super
-
-  if no_cert_file_in_prod?
-    $stderr.puts "******** Diaspora does not know where your SSL-CA-Certificates file is. **********\nPlease add the root certificate bundle (this is operating system specific) to application.yml. Defaults:\nCentOS: '/etc/pki/tls/certs/ca-bundle.crt'\nDebian: '/etc/ssl/certs/ca-certificates.crt'\n\nExample:\nca_file: '/etc/ssl/certs/ca-certificates.crt'\n******** Thanks for being secure! **********\n"
-    Process.exit(1)
-  end
-
-  normalize_pod_url
-  normalize_admins
-end
-
-
-
- -
-

- - + (Boolean) no_cert_file_in_prod? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-79
-80
-81
-
-
# File 'app/models/app_config.rb', line 79
-
-def self.no_cert_file_in_prod?
-  (Rails.env == "production") && self[:ca_file] && !File.exists?(self[:ca_file])
-end
-
-
-
- -
-

- - + (Boolean) no_config_file? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-75
-76
-77
-
-
# File 'app/models/app_config.rb', line 75
-
-def self.no_config_file?
-  !File.exists?(@source)
-end
-
-
-
- -
-

- - + (Object) normalize_admins - - - -

- - - - -
-
-
-
-96
-97
-98
-99
-
-
# File 'app/models/app_config.rb', line 96
-
-def self.normalize_admins
-  self[:admins] ||= []
-  self[:admins].collect! { |username| username.downcase }
-end
-
-
-
- -
-

- - + (Object) normalize_pod_url - - - -

- - - - -
-
-
-
-87
-88
-89
-90
-91
-92
-93
-94
-
-
# File 'app/models/app_config.rb', line 87
-
-def self.normalize_pod_url
-  unless self[:pod_url] =~ /^(https?:\/\/)/ # starts with http:// or https://
-    self[:pod_url] = "http://#{self[:pod_url]}"
-  end
-  unless self[:pod_url] =~ /\/$/ # ends with slash
-    self[:pod_url] = "#{self[:pod_url]}/"
-  end
-end
-
-
-
- -
-

- - + (Object) pod_uri - - - -

- - - - -
-
-
-
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-
-
# File 'app/models/app_config.rb', line 118
-
-def self.pod_uri
-  if @@pod_uri.nil?
-    begin
-      @@pod_uri = URI.parse(self.pod_url)
-    rescue
-      puts "WARNING: pod url " + self.pod_url + " is not a legal URI"
-    end
-  end
-  return @@pod_uri
-end
-
-
-
- -
-

- - + (Object) source_file_name - - - -

- - - - -
-
-
-
-12
-13
-14
-15
-16
-
-
# File 'app/models/app_config.rb', line 12
-
-def self.source_file_name
-  file_name = "application.yml"
-  file_name << ".example" if travis?
-  File.join(Rails.root, "config", file_name)
-end
-
-
-
- -
-

- - + (Boolean) travis? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-8
-9
-10
-
-
# File 'app/models/app_config.rb', line 8
-
-def self.travis?
-  ENV["TRAVIS"]
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/ApplicationController.html b/doc/ApplicationController.html deleted file mode 100644 index a8449a95875..00000000000 --- a/doc/ApplicationController.html +++ /dev/null @@ -1,838 +0,0 @@ - - - - - - Class: ApplicationController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ApplicationController - - - -

- -
- -
Inherits:
-
- ActionController::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/application_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
-

Direct Known Subclasses

-

ActivityStreams::PhotosController, AdminsController, ApisController, AppsController, AspectMembershipsController, AspectsController, CommentsController, ContactsController, ConversationVisibilitiesController, ConversationsController, HomeController, LikesController, MessagesController, NotificationsController, PeopleController, PhotosController, PostVisibilitiesController, PostsController, ProfilesController, PublicsController, ServicesController, SocketsController, StatusMessagesController, TagsController, TokensController, UsersController

-
- - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) after_sign_in_path_for(resource) - - - -

- - - - -
-
-
-
-107
-108
-109
-
-
# File 'app/controllers/application_controller.rb', line 107
-
-def (resource)
-    stored_location_for(:user) || aspects_path
-end
-
-
-
- -
-

- - - (Object) clear_gc_stats - - - -

- - - - -
-
-
-
-74
-75
-76
-
-
# File 'app/controllers/application_controller.rb', line 74
-
-def clear_gc_stats
-  GC.clear_stats if GC.respond_to?(:clear_stats)
-end
-
-
-
- -
-

- - - (Object) ensure_http_referer_is_set - - - -

- - - - -
-
-
-
-20
-21
-22
-
-
# File 'app/controllers/application_controller.rb', line 20
-
-def ensure_http_referer_is_set
-  request.env['HTTP_REFERER'] ||= '/aspects'
-end
-
-
-
- -
-

- - - (Object) ensure_page - - - -

- - - - -
-
-
-
-36
-37
-38
-
-
# File 'app/controllers/application_controller.rb', line 36
-
-def ensure_page
-  params[:page] = params[:page] ? params[:page].to_i : 1
-end
-
-
-
- -
-

- - - (Object) grammatical_gender - - - -

- - - - -
-
-
-
-103
-104
-105
-
-
# File 'app/controllers/application_controller.rb', line 103
-
-def grammatical_gender
-  @grammatical_gender || nil
-end
-
-
-
- -
-

- - - (Object) redirect_unless_admin - - - -

- - - - -
-
-
-
-78
-79
-80
-81
-82
-83
-
-
# File 'app/controllers/application_controller.rb', line 78
-
-def redirect_unless_admin
-  unless current_user.admin?
-    redirect_to root_url, :notice => 'you need to be an admin to do that'
-    return
-  end
-end
-
-
-
- -
-

- - - (Object) set_git_header - - - -

- - - - -
-
-
-
-46
-47
-48
-49
-
-
# File 'app/controllers/application_controller.rb', line 46
-
-def set_git_header
-  headers['X-Git-Update'] = AppConfig[:git_update]
-  headers['X-Git-Revision'] = AppConfig[:git_revision]
-end
-
-
-
- -
-

- - - (Object) set_grammatical_gender - - - -

- - - - -
-
-
-
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-
-
# File 'app/controllers/application_controller.rb', line 85
-
-def set_grammatical_gender
-  if (user_signed_in? && I18n.inflector.inflected_locale?)
-    gender = current_user.profile.gender.to_s.tr('!()[]"\'`*=|/\#.,-:', '').downcase
-    unless gender.empty?
-      i_langs = I18n.inflector.inflected_locales(:gender)
-      i_langs.delete  I18n.locale
-      i_langs.unshift I18n.locale
-      i_langs.each do |lang|
-        token = I18n.inflector.true_token(gender, :gender, lang)
-        unless token.nil?
-          @grammatical_gender = token
-          break
-        end
-      end
-    end
-  end
-end
-
-
-
- -
-

- - - (Object) set_header_data - - - -

- - - - -
-
-
-
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-
-
# File 'app/controllers/application_controller.rb', line 24
-
-def set_header_data
-  if user_signed_in?
-    if request.format.html? && !params[:only_posts]
-      @aspect = nil
-      @notification_count = Notification.for(current_user, :unread =>true).count
-      @unread_message_count = ConversationVisibility.sum(:unread, :conditions => "person_id = #{current_user.person.id}")
-    end
-    @object_aspect_ids = []
-    @all_aspects = current_user.aspects
-  end
-end
-
-
-
- -
-

- - - (Object) set_invites - - - -

- - - - -
-
-
-
-40
-41
-42
-43
-44
-
-
# File 'app/controllers/application_controller.rb', line 40
-
-def set_invites
-  if user_signed_in?
-    @invites = current_user.invites
-  end
-end
-
-
-
- -
-

- - - (Object) set_locale - - - -

- - - - -
-
-
-
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-
-
# File 'app/controllers/application_controller.rb', line 63
-
-def set_locale
-  if user_signed_in?
-    I18n.locale = current_user.language
-  else
-    I18n.locale = request.compatible_language_from AVAILABLE_LANGUAGE_CODES
-  end
-
-  WillPaginate::ViewHelpers.pagination_options[:previous_label] = "&laquo; #{I18n.t('previous')}"
-  WillPaginate::ViewHelpers.pagination_options[:next_label] = "#{I18n.t('next')} &raquo;"
-end
-
-
-
- -
-

- - - (Object) which_action_and_user - - - -

- - - - -
-
-
-
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-
-
# File 'app/controllers/application_controller.rb', line 51
-
-def which_action_and_user
-  str = "event=request_with_user controller=#{self.class} action=#{self.action_name} "
-  if current_user
-    str << "uid=#{current_user.id} "
-    str << "user_created_at='#{current_user.created_at.to_date.to_s}' user_created_at_unix=#{current_user.created_at.to_i} " if current_user.created_at
-    str << "user_non_pending_contact_count=#{current_user.contacts.size} user_contact_count=#{Contact.unscoped.where(:user_id => current_user.id).size} "
-  else
-    str << 'uid=nil'
-  end
-  Rails.logger.info str
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/AppsController.html b/doc/AppsController.html deleted file mode 100644 index 6fda2232d1a..00000000000 --- a/doc/AppsController.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - Class: AppsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: AppsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/apps_controller.rb
- -
-
- - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) show - - - -

- - - - -
-
-
-
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-
-
# File 'app/controllers/apps_controller.rb', line 2
-
-def show
-  @app = 'cubbies'
-  @posts = ActivityStreams::Photo
-  max_time = params[:max_time] ? Time.at(params[:max_time].to_i) : Time.now
-  @posts = @posts.where(ActivityStreams::Photo.arel_table[:created_at].lt(max_time)
-                       ).where(:public => true
-                       ).order('posts.created_at DESC'
-                       ).includes(:author => :profile).limit(30)
-  @commenting_disabled = true
-  @people = []
-  @people_count = 0
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/AspectGlobalHelper.html b/doc/AspectGlobalHelper.html deleted file mode 100644 index 5c22a75ffde..00000000000 --- a/doc/AspectGlobalHelper.html +++ /dev/null @@ -1,761 +0,0 @@ - - - - - - Module: AspectGlobalHelper - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: AspectGlobalHelper - - - -

- -
- - - - - - - - -
Defined in:
-
app/helpers/aspect_global_helper.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) aspect_badge(aspect, opts = {}) - - - -

- - - - -
-
-
-
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-
-
# File 'app/helpers/aspect_global_helper.rb', line 26
-
-def aspect_badge(aspect, opts={})
-  str = "<span class='aspect_badge single'>"
-  link = opts.delete(:link)
-  if !link
-    str << link_to(aspect.name, "#", 'data-guid' => aspect.id, :class => 'hard_aspect_link').html_safe
-  else
-    str << link_for_aspect(aspect).html_safe
-  end
-  str << "</span>"
-end
-
-
-
- -
-

- - - (Object) aspect_badges(aspects, opts = {}) - - - -

- - - - -
-
-
-
-18
-19
-20
-21
-22
-23
-24
-
-
# File 'app/helpers/aspect_global_helper.rb', line 18
-
-def aspect_badges(aspects, opts={})
-  str = ''
-  aspects.each do |aspect|
-    str << aspect_badge(aspect, opts)
-  end
-  str.html_safe
-end
-
-
-
- -
-

- - - (Object) aspect_dropdown_list_item(aspect, contact, person) - - - -

- - - - -
-
-
-
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-
-
# File 'app/helpers/aspect_global_helper.rb', line 85
-
-def aspect_dropdown_list_item(aspect, contact, person)
-  checked = (contact.persisted? && contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id})
-  klass = checked ? "selected" : ""
-   = !checked ? "hidden" : ""
-
-  str = "<li data-aspect_id=#{aspect.id} class='#{klass}'>"
-  #str << "<input #{checked} id=\"in_aspect\" name=\"in_aspect\" type=\"checkbox\" value=\"in_aspect\" />"
-  str << "<img src='/images/icons/check_yes_ok.png' width=18 height=18 class='check #{hidden}'/>"
-  str << "<img src='/images/icons/check_yes_ok_white.png' width=18 height=18 class='checkWhite'/>"
-  str << aspect.name
-  str << "<div class=\"hidden\">"
-  str << aspect_membership_button(aspect, contact, person)
-  str << "</div>"
-  str << "</li>"
-  str.html_safe
-end
-
-
-
- -
-

- - - (Object) aspect_li(aspect, opts = {}) - - - -

- - - - -
-
-
-
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-
-
# File 'app/helpers/aspect_global_helper.rb', line 47
-
-def aspect_li(aspect, opts={})
-  param_string = ""
-  if opts.size > 0
-    param_string << '?'
-    opts.each_pair do |k, v|
-      param_string << "#{k}=#{v}"
-    end
-  end
-"<li>
-<a href='/aspects/#{aspect.id}#{param_string}'>
-  #{aspect.name}
-</a>
-</li>".html_safe
-end
-
-
-
- -
- - - - - -
-
-
-
-37
-38
-39
-40
-41
-42
-43
-44
-45
-
-
# File 'app/helpers/aspect_global_helper.rb', line 37
-
-def aspect_links(aspects, opts={})
-  str = ""
-  aspects.each do |aspect|
-    str << '<li>'
-    str << link_for_aspect(aspect, :params => opts, 'data-guid' => aspect.id, :class => 'hard_aspect_link').html_safe
-    str << '</li>'
-  end
-  str.html_safe
-end
-
-
-
- -
-

- - - (Object) aspect_or_all_path(aspect) - - - -

- - - - -
-
-
-
-77
-78
-79
-80
-81
-82
-83
-
-
# File 'app/helpers/aspect_global_helper.rb', line 77
-
-def aspect_or_all_path(aspect)
-  if @aspect.is_a? Aspect
-    aspect_path @aspect
-  else
-    aspects_path
-  end
-end
-
-
-
- -
-

- - - (Object) aspects_with_post(aspects, post) - - - -

- - - - -
-
-
-
-6
-7
-8
-9
-10
-
-
# File 'app/helpers/aspect_global_helper.rb', line 6
-
-def aspects_with_post(aspects, post)
-  aspects.select do |aspect|
-    AspectVisibility.exists?(:aspect_id => aspect.id, :post_id => post.id)
-  end
-end
-
-
-
- -
-

- - - (Object) aspects_without_post(aspects, post) - - - -

- - - - -
-
-
-
-12
-13
-14
-15
-16
-
-
# File 'app/helpers/aspect_global_helper.rb', line 12
-
-def aspects_without_post(aspects, post)
-  aspects.reject do |aspect|
-    AspectVisibility.exists?(:aspect_id => aspect.id, :post_id => post.id)
-  end
-end
-
-
-
- -
-

- - - (Boolean) current_aspect?(aspect) - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-73
-74
-75
-
-
# File 'app/helpers/aspect_global_helper.rb', line 73
-
-def current_aspect?(aspect)
-  !@aspect.nil? && !@aspect.instance_of?(Symbol) && @aspect.id == aspect.id
-end
-
-
-
- -
- - - - - -
-
-
-
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-
-
# File 'app/helpers/aspect_global_helper.rb', line 62
-
-def link_for_aspect(aspect, opts={})
-  opts[:params] ||= {}
-  params ||= {}
-  opts[:params] = opts[:params].merge("a_ids[]" => aspect.id, :created_at => params[:created_at])
-  opts[:class] ||= ""
-  opts[:class] << " hard_aspect_link"
-  opts['data-guid'] = aspect.id
-
-  link_to aspect.name, aspects_path( opts[:params] ), opts
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/AspectMembership.html b/doc/AspectMembership.html deleted file mode 100644 index aa4ed2544d7..00000000000 --- a/doc/AspectMembership.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Class: AspectMembership - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: AspectMembership - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/aspect_membership.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - -
- - - - - \ No newline at end of file diff --git a/doc/AspectMembershipsController.html b/doc/AspectMembershipsController.html deleted file mode 100644 index 42e9de6f4b0..00000000000 --- a/doc/AspectMembershipsController.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - Class: AspectMembershipsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: AspectMembershipsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/aspect_memberships_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) create - - - -

- - - - -
-
-
-
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-
-
# File 'app/controllers/aspect_memberships_controller.rb', line 35
-
-def create
-  @person = Person.find(params[:person_id])
-  @aspect = current_user.aspects.where(:id => params[:aspect_id]).first
-
-  if @contact = current_user.(@person, @aspect)
-
-    flash.now[:notice] =  I18n.t 'aspects.add_to_aspect.success'
-
-  else
-    flash[:error] = I18n.t 'contacts.create.failure'
-    redirect_to :back
-  end
-end
-
-
-
- -
-

- - - (Object) destroy - - - -

- - - - -
-
-
-
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-
-
# File 'app/controllers/aspect_memberships_controller.rb', line 9
-
-def destroy
-  #note :id is garbage
-
-  @person_id = params[:person_id]
-  @aspect_id = params[:aspect_id]
-
-  @contact = current_user.contact_for(Person.where(:id => @person_id).first)
-  membership = @contact ? @contact.aspect_memberships.where(:aspect_id => @aspect_id).first : nil
-
-  if membership && membership.destroy 
-      @aspect = membership.aspect
-
-      flash.now[:notice] = I18n.t 'aspect_memberships.destroy.success'
-
-    else
-      flash.now[:error] = I18n.t 'aspect_memberships.destroy.failure'
-      errors = membership ? membership.errors.full_messages : t('aspect_memberships.destroy.no_membership')
-      respond_to do |format|
-        format.js  { render :text => errors, :status => 403 }
-        format.html{
-          redirect_to :back
-        }
-    end
-  end
-end
-
-
-
- -
-

- - - (Object) update - - - -

- - - - -
-
-
-
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-
-
# File 'app/controllers/aspect_memberships_controller.rb', line 49
-
-def update
-  @person = Person.find(params[:person_id])
-  @from_aspect = current_user.aspects.where(:id => params[:aspect_id]).first
-  @to_aspect = current_user.aspects.where(:id => params[:to]).first
-
-  response_hash = { }
-
-  unless current_user.move_contact( @person, @to_aspect, @from_aspect)
-    flash[:error] = I18n.t 'aspects.move_contact.error',:inspect => params.inspect
-  end
-  if aspect = current_user.aspects.where(:id => params[:to]).first
-    response_hash[:notice] = I18n.t 'aspects.move_contact.success'
-    response_hash[:success] = true
-  else
-    response_hash[:notice] = I18n.t 'aspects.move_contact.failure'
-    response_hash[:success] = false
-  end
-
-  render :text => response_hash.to_json
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/AspectsHelper.html b/doc/AspectsHelper.html deleted file mode 100644 index be8086f2fef..00000000000 --- a/doc/AspectsHelper.html +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - Module: AspectsHelper - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: AspectsHelper - - - -

- -
- - - - - - - - -
Defined in:
-
app/helpers/aspects_helper.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) add_to_aspect_button(aspect_id, person_id) - - - -

- - - - -
-
-
-
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-
-
# File 'app/helpers/aspects_helper.rb', line 14
-
-def add_to_aspect_button(aspect_id, person_id)
-  link_to image_tag('icons/monotone_plus_add_round.png'),
-    {:controller => 'aspect_memberships',
-      :action => 'create',
-      :aspect_id => aspect_id,
-      :person_id => person_id},
-    :remote => true,
-    :method => 'post',
-    :class => 'add button',
-    'data-aspect_id' => aspect_id,
-    'data-person_id' => person_id
-end
-
-
-
- -
-

- - - (Object) aspect_membership_button(aspect, contact, person) - - - -

- - - - -
-
-
-
-41
-42
-43
-44
-45
-46
-47
-
-
# File 'app/helpers/aspects_helper.rb', line 41
-
-def aspect_membership_button(aspect, contact, person)
-  if contact.nil? || !contact.aspect_memberships.detect{ |am| am.aspect_id == aspect.id}
-    add_to_aspect_button(aspect.id, person.id)
-  else
-    remove_from_aspect_button(aspect.id, person.id)
-  end
-end
-
-
-
- -
-

- - - (Object) remove_from_aspect_button(aspect_id, person_id) - - - -

- - - - -
-
-
-
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-
-
# File 'app/helpers/aspects_helper.rb', line 27
-
-def remove_from_aspect_button(aspect_id, person_id)
-  link_to image_tag('icons/monotone_check_yes.png'),
-    {:controller => "aspect_memberships",
-      :action => 'destroy',
-      :id => 42,
-      :aspect_id => aspect_id,
-      :person_id => person_id},
-    :remote => true,
-    :method => 'delete',
-    :class => 'added button',
-    'data-aspect_id' => aspect_id,
-    'data-person_id' => person_id
-end
-
-
-
- -
- - - - - -
-
-
-
-6
-7
-8
-9
-10
-11
-12
-
-
# File 'app/helpers/aspects_helper.rb', line 6
-
-def remove_link(aspect)
-  if aspect.contacts.size == 0
-    link_to I18n.t('aspects.helper.remove'), aspect, :method => :delete, :confirm => I18n.t('aspects.helper.are_you_sure')
-  else
-    "<span class='grey' title=#{I18n.t('aspects.helper.aspect_not_empty')}>#{I18n.t('aspects.helper.remove')}</span>"
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/ContactsController.html b/doc/ContactsController.html deleted file mode 100644 index b33f227ebd3..00000000000 --- a/doc/ContactsController.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - Class: ContactsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ContactsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/contacts_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) sharing - - - -

- - - - -
-
-
-
-8
-9
-10
-11
-
-
# File 'app/controllers/contacts_controller.rb', line 8
-
-def 
-  @contacts = current_user.contacts..includes(:aspect_memberships)
-  render :layout => false
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/ConversationVisibilitiesController.html b/doc/ConversationVisibilitiesController.html deleted file mode 100644 index f55e0511e48..00000000000 --- a/doc/ConversationVisibilitiesController.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - Class: ConversationVisibilitiesController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ConversationVisibilitiesController - - - -

- -
- -
Inherits:
-
- ApplicationController - -
    -
  • Object
  • - - - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/conversation_visibilities_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) destroy - - - -

- - - - -
-
-
-
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-
-
# File 'app/controllers/conversation_visibilities_controller.rb', line 9
-
-def destroy
-  @vis = ConversationVisibility.where(:person_id => current_user.person.id,
-                                      :conversation_id => params[:conversation_id]).first
-  if @vis
-    if @vis.destroy
-      flash[:notice] = I18n.t('conversations.destroy.success')
-    end
-  end
-  redirect_to conversations_path
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/ConversationsController.html b/doc/ConversationsController.html deleted file mode 100644 index 53b1bf0575c..00000000000 --- a/doc/ConversationsController.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - Class: ConversationsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ConversationsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/conversations_controller.rb
- -
-
- - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) create - - - -

- - - - -
-
-
-
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-
-
# File 'app/controllers/conversations_controller.rb', line 24
-
-def create
-  person_ids = Contact.where(:id => params[:contact_ids].split(',')).map! do |contact|
-    contact.person_id
-  end
-
-  params[:conversation][:participant_ids] = person_ids | [current_user.person.id]
-  params[:conversation][:author] = current_user.person
-
-  if @conversation = Conversation.create(params[:conversation])
-    Postzord::Dispatch.new(current_user, @conversation).post
-
-    flash[:notice] = I18n.t('conversations.create.sent')
-    if params[:profile]
-      redirect_to person_path(params[:profile])
-    else
-      redirect_to conversations_path(:conversation_id => @conversation.id)
-    end
-  end
-end
-
-
-
- -
-

- - - (Object) index - - - -

- - - - -
-
-
-
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-
-
# File 'app/controllers/conversations_controller.rb', line 6
-
-def index
-  @conversations = Conversation.joins(:conversation_visibilities).where(
-    :conversation_visibilities => {:person_id => current_user.person.id}).paginate(
-    :page => params[:page], :per_page => 15, :order => 'updated_at DESC')
-
-  @visibilities = ConversationVisibility.where(:person_id => current_user.person.id).paginate(
-    :page => params[:page], :per_page => 15, :order => 'updated_at DESC')
-
-  @unread_counts = {}
-  @visibilities.each { |v| @unread_counts[v.conversation_id] = v.unread }
-
-  @authors = {}
-  @conversations.each { |c| @authors[c.id] = c.last_author }
-
-  @conversation = Conversation.joins(:conversation_visibilities).where(
-    :conversation_visibilities => {:person_id => current_user.person.id, :conversation_id => params[:conversation_id]}).first
-end
-
-
-
- -
-

- - - (Object) new - - - -

- - - - -
-
-
-
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-
-
# File 'app/controllers/conversations_controller.rb', line 58
-
-def new
-  all_contacts_and_ids = Contact.connection.execute(current_user.contacts.joins(:person => :profile
-    ).select("contacts.id, profiles.first_name, profiles.last_name, people.diaspora_handle").to_sql).map do |r|
-    {:value => r[0],
-     :name => Person.name_from_attrs(r[1], r[2], r[3]).gsub(/(")/, "'")}
-  end
-  @contacts_json = all_contacts_and_ids.to_json.gsub!(/(")/, '\\"')
-  @contact = current_user.contacts.find(params[:contact_id]) if params[:contact_id]
-  render :layout => false
-end
-
-
-
- -
-

- - - (Object) show - - - -

- - - - -
-
-
-
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-
-
# File 'app/controllers/conversations_controller.rb', line 44
-
-def show
-  if @conversation = Conversation.joins(:conversation_visibilities).where(:id => params[:id],
-                                                                          :conversation_visibilities => {:person_id => current_user.person.id}).first
-    if @visibility = ConversationVisibility.where(:conversation_id => params[:id], :person_id => current_user.person.id).first
-      @visibility.unread = 0
-      @visibility.save
-    end
-
-    respond_with @conversation
-  else
-    redirect_to conversations_path
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Diaspora/Director.html b/doc/Diaspora/Director.html deleted file mode 100644 index 08dfb4d37d6..00000000000 --- a/doc/Diaspora/Director.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - Class: Diaspora::Director - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Diaspora::Director - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
lib/diaspora/ostatus_builder.rb
- -
-
- - - - - - - -

- Instance Method Summary - (collapse) -

- - - - -
-

Constructor Details

- -
-

- - - (Director) initialize - - - -

-
-

-A new instance of Director -

- - -
-
-
- -
- - - - -
-
-
-
-8
-9
-10
-11
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 8
-
-def initialize
-  @structure = [:create_headers, :create_endpoints, :create_subject,
-                :create_body, :create_footer]
-end
-
-
-
- -
- - -
-

Instance Method Details

- - -
-

- - - (Object) build(builder) - - - -

- - - - -
-
-
-
-13
-14
-15
-16
-17
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 13
-
-def build(builder)
-  @structure.inject("") do |xml, method|
-    xml << builder.send(method) if builder.respond_to? method
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Diaspora/Guid.html b/doc/Diaspora/Guid.html deleted file mode 100644 index ca6dd3c1ea6..00000000000 --- a/doc/Diaspora/Guid.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - Module: Diaspora::Guid - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Diaspora::Guid - - - -

- -
- - - - - - - -
Included in:
-
Comment, Conversation, Like, Message, Person, Post
- - - -
Defined in:
-
lib/diaspora/guid.rb
- -
-
- - - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Class Method Details

- - -
-

- - + (Object) included(model) - - - -

- - - - -
-
-
-
-2
-3
-4
-5
-6
-7
-
-
# File 'lib/diaspora/guid.rb', line 2
-
-def self.included(model)
-  model.class_eval do
-    before_create :set_guid
-    xml_attr :guid
-  end
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Object) set_guid - - - -

- - - - -
-
-
-
-8
-9
-10
-
-
# File 'lib/diaspora/guid.rb', line 8
-
-def set_guid
-  self.guid ||= ActiveSupport::SecureRandom.hex(8)
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Diaspora/OstatusBuilder.html b/doc/Diaspora/OstatusBuilder.html deleted file mode 100644 index d4b253b92f7..00000000000 --- a/doc/Diaspora/OstatusBuilder.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - - - Class: Diaspora::OstatusBuilder - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Diaspora::OstatusBuilder - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - -
Includes:
-
Webhooks
- - - - - -
Defined in:
-
lib/diaspora/ostatus_builder.rb
- -
-
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Webhooks

-

#receive, #subscribers, #to_diaspora_xml, #x

-
-

Constructor Details

- -
-

- - - (OstatusBuilder) initialize(user, posts) - - - -

-
-

-A new instance of OstatusBuilder -

- - -
-
-
- -
- - - - -
-
-
-
-24
-25
-26
-27
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 24
-
-def initialize(user, posts)
-  @user = user
-  @posts = posts
-end
-
-
-
- -
- - -
-

Instance Method Details

- - -
-

- - - (Object) create_body - - - -

- - - - -
-
-
-
-66
-67
-68
-69
-70
-71
-72
-73
-74
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 66
-
-def create_body
-  @posts.inject("") do |xml,curr|
-    if curr.respond_to?(:to_activity)
-      xml + curr.to_activity(:author => @user.person)
-    else
-      xml
-    end
-  end
-end
-
-
-
- -
-

- - - (Object) create_endpoints - - - -

- - - - -
-
-
-
-58
-59
-60
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 58
-
-def create_endpoints
-  "<link href=\"\#{AppConfig[:pubsub_server]}\" rel=\"hub\"/>\n<link href=\"\#{@user.public_url}.atom\" rel=\"self\" type=\"application/atom+xml\"/>\n"
-end
-
-
-
- -
- - - - - -
-
-
-
-76
-77
-78
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 76
-
-def create_footer
-  "</feed>\n"
-end
-
-
-
- -
-

- - - (Object) create_headers - - - -

- - - - -
-
-
-
-29
-30
-31
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 29
-
-def create_headers
-  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<feed xml:lang=\"en-US\" xmlns=\"http://www.w3.org/2005/Atom\" xmlns:thr=\"http://purl.org/syndication/thread/1.0\" xmlns:georss=\"http://www.georss.org/georss\" xmlns:activity=\"http://activitystrea.ms/spec/1.0/\" xmlns:media=\"http://purl.org/syndication/atommedia\" xmlns:poco=\"http://portablecontacts.net/spec/1.0\" xmlns:ostatus=\"http://ostatus.org/schema/1.0\" xmlns:statusnet=\"http://status.net/schema/api/1/\">\n<generator uri=\"\#{AppConfig[:pod_url]}\">Diaspora</generator>\n<id>\#{@user.public_url}.atom</id>\n<title>\#{x(@user.name)}'s Public Feed</title>\n<subtitle>Updates from \#{x(@user.name)} on Diaspora</subtitle>\n<logo>\#{@user.person.profile.image_url(:thumb_small)}</logo>\n<updated>\#{Time.now.xmlschema}</updated>\n"
-end
-
-
-
- -
-

- - - (Object) create_subject - - - -

- - - - -
-
-
-
-43
-44
-45
-
-
# File 'lib/diaspora/ostatus_builder.rb', line 43
-
-def create_subject
-  "<author>\n<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>\n<name>\#{x(@user.name)}</name>\n<uri>\#{AppConfig[:pod_url]}people/\#{@user.person.id}</uri>\n<link rel=\"alternate\" type=\"text/html\" href=\"\#{@user.public_url}\" />\n<poco:preferredUsername>\#{x(@user.username)}</poco:preferredUsername>\n<poco:displayName>\#{x(@user.person.name)}</poco:displayName>\n<link rel=\"avatar\" type=\"image/jpeg\" media:width=\"100\" media:height=\"100\" href=\"\#{@user.profile.image_url}\"/>\n</author>\n"
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Diaspora/UserModules/Querying.html b/doc/Diaspora/UserModules/Querying.html deleted file mode 100644 index cec8968394a..00000000000 --- a/doc/Diaspora/UserModules/Querying.html +++ /dev/null @@ -1,775 +0,0 @@ - - - - - - Module: Diaspora::UserModules::Querying - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Diaspora::UserModules::Querying - - - -

- -
- - - - - - - -
Included in:
-
Diaspora::UserModules
- - - -
Defined in:
-
lib/diaspora/user/querying.rb
- -
-
- - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) all_aspect_ids - - - -

- - - - -
-
-
-
-89
-90
-91
-
-
# File 'lib/diaspora/user/querying.rb', line 89
-
-def all_aspect_ids
-  self.aspects.all.collect{|x| x.id}
-end
-
-
-
- -
-

- - - (Object) aspects_with_person(person) - - - -

- - - - -
-
-
-
-79
-80
-81
-
-
# File 'lib/diaspora/user/querying.rb', line 79
-
-def aspects_with_person person
-  contact_for(person).aspects
-end
-
-
-
- -
-

- - - (Object) aspects_with_post(post_id) - - - -

- - - - -
-
-
-
-58
-59
-60
-
-
# File 'lib/diaspora/user/querying.rb', line 58
-
-def aspects_with_post(post_id)
-  self.aspects.joins(:aspect_visibilities).where(:aspect_visibilities => {:post_id => post_id})
-end
-
-
-
- -
-

- - - (Object) contact_for(person) - - - -

- - - - -
-
-
-
-54
-55
-56
-57
-
-
# File 'lib/diaspora/user/querying.rb', line 54
-
-def contact_for(person)
-  return nil unless person
-  contact_for_person_id(person.id)
-end
-
-
-
- -
-

- - - (Object) contact_for_person_id(person_id) - - - -

- - - - -
-
-
-
-62
-63
-64
-
-
# File 'lib/diaspora/user/querying.rb', line 62
-
-def contact_for_person_id(person_id)
-  Contact.where(:user_id => self.id, :person_id => person_id).includes(:person => :profile).first
-end
-
-
-
- -
-

- - - (Object) contacts_in_aspects(aspects) - - - -

- - - - -
-
-
-
-83
-84
-85
-86
-87
-
-
# File 'lib/diaspora/user/querying.rb', line 83
-
-def contacts_in_aspects aspects
-  aspects.inject([]) do |contacts,aspect|
-    contacts | aspect.contacts
-  end
-end
-
-
-
- -
-

- - - (Object) find_visible_post_by_id(id, opts = {}) - - - -

- - - - -
-
-
-
-9
-10
-11
-12
-13
-
-
# File 'lib/diaspora/user/querying.rb', line 9
-
-def find_visible_post_by_id( id, opts={} )
-  post = Post.where(:id => id).joins(:contacts).where(:contacts => {:user_id => self.id}).where(opts).first
-  post ||= Post.where(:id => id, :author_id => self.person.id).where(opts).first
-  post ||= Post.where(:id => id, :public => true).where(opts).first
-end
-
-
-
- -
-

- - - (Object) people_in_aspects(requested_aspects, opts = {}) - - - -

- - - - -
-
-
-
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-
-
# File 'lib/diaspora/user/querying.rb', line 66
-
-def people_in_aspects(requested_aspects, opts={})
-  allowed_aspects = self.aspects & requested_aspects
-  person_ids = contacts_in_aspects(allowed_aspects).collect{|contact| contact.person_id}
-  people = Person.where(:id => person_ids)
-
-  if opts[:type] == 'remote'
-    people = people.where(:owner_id => nil)
-  elsif opts[:type] == 'local'
-    people = people.where('people.owner_id IS NOT NULL')
-  end
-  people
-end
-
-
-
- -
-

- - - (Object) posts_from(person) - - - -

- - - - -
-
-
-
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-
-
# File 'lib/diaspora/user/querying.rb', line 93
-
-def posts_from(person)
-  return self.person.posts.where(:pending => false).order("created_at DESC") if person == self.person
-  con = Contact.arel_table
-  p = Post.arel_table
-  post_ids = []
-  if contact = self.contact_for(person)
-    post_ids = Post.connection.execute(contact.post_visibilities.where(:hidden => false).select('post_visibilities.post_id').to_sql).map{|r| r.first}
-  end
-  post_ids += Post.connection.execute(person.posts.where(:public => true).select('posts.id').to_sql).map{|r| r.first}
-
-  Post.where(:id => post_ids, :pending => false).select('DISTINCT posts.*').order("posts.created_at DESC")
-end
-
-
-
- -
-

- - - (Object) visible_photos(opts = {}) - - - -

- - - - -
-
-
-
-50
-51
-52
-
-
# File 'lib/diaspora/user/querying.rb', line 50
-
-def visible_photos(opts = {})
-  visible_posts(opts.merge(:type => 'Photo'))
-end
-
-
-
- -
-

- - - (Object) visible_posts(opts = {}) - - - -

- - - - -
-
-
-
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-
-
# File 'lib/diaspora/user/querying.rb', line 15
-
-def visible_posts(opts = {})
-  defaults = {
-    :type => ['StatusMessage', 'Photo'],
-    :order => 'updated_at DESC',
-    :limit => 15,
-    :hidden => false
-  }
-  opts = defaults.merge(opts)
-
-  order_field = opts[:order].split.first.to_sym
-  order_with_table = 'posts.' + opts[:order]
-
-  opts[:max_time] = Time.at(opts[:max_time]) if opts[:max_time].is_a?(Integer)
-  opts[:max_time] ||= Time.now + 1
-
-  select_clause ='DISTINCT posts.id, posts.updated_at AS updated_at, posts.created_at AS created_at'
-
-  posts_from_others = Post.joins(:contacts).where( :pending => false, :type => opts[:type], :post_visibilities => {:hidden => opts[:hidden]}, :contacts => {:user_id => self.id})
-  posts_from_self = self.person.posts.where(:pending => false, :type => opts[:type])
-
-  if opts[:by_members_of]
-    posts_from_others = posts_from_others.joins(:contacts => :aspect_memberships).where(
-      :aspect_memberships => {:aspect_id => opts[:by_members_of]})
-    posts_from_self = posts_from_self.joins(:aspect_visibilities).where(:aspect_visibilities => {:aspect_id => opts[:by_members_of]})
-  end
-
-  posts_from_others = posts_from_others.select(select_clause).limit(opts[:limit]).order(order_with_table).where(Post.arel_table[order_field].lt(opts[:max_time]))
-  posts_from_self = posts_from_self.select(select_clause).limit(opts[:limit]).order(order_with_table).where(Post.arel_table[order_field].lt(opts[:max_time]))
-
-  all_posts = "(#{posts_from_others.to_sql}) UNION ALL (#{posts_from_self.to_sql}) ORDER BY #{opts[:order]} LIMIT #{opts[:limit]}"
-  post_ids = Post.connection.execute(all_posts).map{|r| r.first}
-
-  Post.where(:id => post_ids).select('DISTINCT posts.*').limit(opts[:limit]).order(order_with_table)
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Diaspora/WebSocket.html b/doc/Diaspora/WebSocket.html deleted file mode 100644 index ca8e8d9b1a8..00000000000 --- a/doc/Diaspora/WebSocket.html +++ /dev/null @@ -1,671 +0,0 @@ - - - - - - Module: Diaspora::WebSocket - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Diaspora::WebSocket - - - -

- -
- - - - - - - - -
Defined in:
-
lib/diaspora/web_socket.rb
- -
-
- - -

Constant Summary

- -
- -
REDIS_CONNECTION_SET = - -
-
'ws-uids'
-
- -
- - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - -
-

Class Method Details

- - -
-

- - + (Object) ensure_channel(uid) - - - -

- - - - -
-
-
-
-42
-43
-44
-
-
# File 'lib/diaspora/web_socket.rb', line 42
-
-def self.ensure_channel(uid)
-  @channels[uid] ||= [EM::Channel.new, 0 ]
-end
-
-
-
- -
-

- - + (Object) initialize_channels - - - -

- - - - -
-
-
-
-20
-21
-22
-
-
# File 'lib/diaspora/web_socket.rb', line 20
-
-def self.initialize_channels
-  @channels = {}
-end
-
-
-
- -
-

- - + (Boolean) is_connected?(uid) - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-56
-57
-58
-
-
# File 'lib/diaspora/web_socket.rb', line 56
-
-def self.is_connected?(uid)
-  redis.sismember(REDIS_CONNECTION_SET, uid)
-end
-
-
-
- -
-

- - + (Object) length - - - -

- - - - -
-
-
-
-13
-14
-15
-
-
# File 'lib/diaspora/web_socket.rb', line 13
-
-def self.length
-  redis.llen :websocket
-end
-
-
-
- -
-

- - + (Object) next - - - -

- - - - -
-
-
-
-24
-25
-26
-
-
# File 'lib/diaspora/web_socket.rb', line 24
-
-def self.next
-  redis.rpop(:websocket)
-end
-
-
-
- -
-

- - + (Object) push_to_user(uid, data) - - - -

- - - - -
-
-
-
-28
-29
-30
-31
-
-
# File 'lib/diaspora/web_socket.rb', line 28
-
-def self.push_to_user(uid, data)
-  Rails.logger.debug "event=socket-push uid=#{uid}"
-  @channels[uid][0].push(data) if @channels[uid]
-end
-
-
-
- -
-

- - + (Object) queue_to_user(uid, data) - - - -

- - - - -
-
-
-
-16
-17
-18
-
-
# File 'lib/diaspora/web_socket.rb', line 16
-
-def self.queue_to_user(uid, data)
-  redis.lpush(:websocket, {:uid => uid, :data => data}.to_json)
-end
-
-
-
- -
-

- - + (Object) redis - - - -

- - - - -
-
-
-
-10
-11
-12
-
-
# File 'lib/diaspora/web_socket.rb', line 10
-
-def self.redis
-  @redis ||= Resque.redis
-end
-
-
-
- -
-

- - + (Object) subscribe(uid, ws) - - - -

- - - - -
-
-
-
-33
-34
-35
-36
-37
-38
-39
-40
-
-
# File 'lib/diaspora/web_socket.rb', line 33
-
-def self.(uid, ws)
-  Rails.logger.info "event=socket-subscribe uid=#{uid} channels=#{self.length}"
-  self.ensure_channel(uid)
-  @channels[uid][0].{ |msg| ws.send msg }
-  @channels[uid][1] += 1
-
-  redis.sadd(REDIS_CONNECTION_SET, uid)
-end
-
-
-
- -
-

- - + (Object) unsubscribe(uid, sid) - - - -

- - - - -
-
-
-
-46
-47
-48
-49
-50
-51
-52
-53
-54
-
-
# File 'lib/diaspora/web_socket.rb', line 46
-
-def self.unsubscribe(uid,sid)
-  Rails.logger.info "event=socket-unsubscribe sid=#{sid} uid=#{uid} channels=#{self.length}"
-  @channels[uid][0].unsubscribe(sid) if @channels[uid]
-  @channels[uid][1] -= 1
-  if @channels[uid][1] <= 0
-    @channels.delete(uid)
-    redis.srem(REDIS_CONNECTION_SET, uid)
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Diaspora/Webhooks.html b/doc/Diaspora/Webhooks.html deleted file mode 100644 index 73bf2fcc85a..00000000000 --- a/doc/Diaspora/Webhooks.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - Module: Diaspora::Webhooks - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Diaspora::Webhooks - - - -

- -
- - - - - - - -
Included in:
-
Comment, Conversation, OstatusBuilder, Like, Message, Post, Profile, RelayableRetraction, Request, Retraction
- - - -
Defined in:
-
lib/diaspora/webhooks.rb
- -
-
- - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) receive(user, person) - - - -

- - - - -
-
-
-
-23
-24
-25
-
-
# File 'lib/diaspora/webhooks.rb', line 23
-
-def receive(user, person)
-  raise 'you must override receive in order to enable federation on this model'
-end
-
-
-
- -
-

- - - (Object) subscribers(user) - - - -

- - - - -
-
-
-
-19
-20
-21
-
-
# File 'lib/diaspora/webhooks.rb', line 19
-
-def subscribers(user)
-  raise 'you must override subscribers in order to enable federation on this model'
-end
-
-
-
- -
-

- - - (Object) to_diaspora_xml - - - -

- - - - -
-
-
-
-9
-10
-11
-12
-13
-
-
# File 'lib/diaspora/webhooks.rb', line 9
-
-def to_diaspora_xml
-  xml = "<XML>"
-  xml += "<post>#{to_xml.to_s}</post>"
-  xml += "</XML>"
-end
-
-
-
- -
-

- - - (Object) x(input) - - - -

- - - - -
-
-
-
-15
-16
-17
-
-
# File 'lib/diaspora/webhooks.rb', line 15
-
-def x(input)
-  input.to_s.to_xs
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Encryptor.html b/doc/Encryptor.html deleted file mode 100644 index 662bee0b4ed..00000000000 --- a/doc/Encryptor.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - Module: Encryptor - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Encryptor - - - -

- -
- - - - - - - - -
Defined in:
-
lib/encryptor.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -

Defined Under Namespace

-

- - - Modules: Private, Public - - - - -

- - - - - - - -
- - - - - \ No newline at end of file diff --git a/doc/Job/Base.html b/doc/Job/Base.html deleted file mode 100644 index 61e5767da5b..00000000000 --- a/doc/Job/Base.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - Class: Job::Base - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Job::Base - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - -
Extended by:
-
ResqueJobLogging
- - - - - - - -
Defined in:
-
app/models/jobs/base.rb
- -
-
- -
-

Direct Known Subclasses

-

DeleteAccount, HttpMulti, HttpPost, InviteUserByEmail, MailAlsoCommented, MailCommentOnPost, MailLiked, MailMentioned, MailPrivateMessage, MailStartedSharing, NotifyLocalUsers, PostToService, ProcessPhoto, PublishToHub, Receive, ReceiveLocalBatch, ReceiveSalmon, ResendInvitation, SocketWebfinger, UpdateServiceUsers

-
- - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from ResqueJobLogging

-

application_trace, around_perform_log_job

- - -
-

Class Method Details

- - -
-

- - + (Object) perform(*args) - - - -

- - - - -
-
-
-
-5
-6
-7
-8
-
-
# File 'app/models/jobs/base.rb', line 5
-
-def self.perform(*args)  
-  ActiveRecord::Base.verify_active_connections!  
-  self.perform_delegate(*args)  
-end
-
-
-
- -
-

- - + (Object) perform_delegate(*args) - - - -

-
-

-override this -

- - -
-
-
- -
- - - - -
-
-
-
-10
-11
-
-
# File 'app/models/jobs/base.rb', line 10
-
-def self.perform_delegate(*args) # override this  
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Job/HttpMulti.html b/doc/Job/HttpMulti.html deleted file mode 100644 index 04b89886eb0..00000000000 --- a/doc/Job/HttpMulti.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - Class: Job::HttpMulti - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Job::HttpMulti - - - -

- -
- -
Inherits:
-
- Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/jobs/http_multi.rb
- -
-
- - -

Constant Summary

- -
- -
Hydra = - -
-
Typhoeus::Hydra
-
- -
Request = - -
-
Typhoeus::Request
-
- -
MAX_RETRIES = - -
-
3
-
- -
OPTS = - -
-
{:max_redirects => 3, :timeout => 5000, :method => :post}
-
- -
- - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from Base

-

perform

- - - - - - - - -

Methods included from ResqueJobLogging

-

#application_trace, #around_perform_log_job

- - -
-

Class Method Details

- - -
-

- - + (Object) perform_delegate(user_id, enc_object_xml, person_ids, retry_count = 0) - - - -

- - - - -
-
-
-
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-
-
# File 'app/models/jobs/http_multi.rb', line 16
-
-def self.perform_delegate(user_id, enc_object_xml, person_ids, retry_count=0)
-  user = User.find(user_id)
-  people = Person.where(:id => person_ids)
-
-  salmon = Salmon::SalmonSlap.create(user, Base64.decode64(enc_object_xml))
-
-  failed_request_people = []
-
-  hydra = Hydra.new
-  people.each do |person|
-
-    url = person.receive_url
-    xml = salmon.xml_for(person)
-
-    request = Request.new(url, OPTS.merge(:params => {:xml => CGI::escape(xml)}))
-
-    request.on_complete do |response|
-      if response.code >= 300 && response.code < 400
-        if response.headers_hash['Location'] == response.request.url.sub('http://', 'https://')
-          location = URI.parse(response.headers_hash['Location'])
-          newuri = "#{location.scheme}://#{location.host}"
-          newuri += ":#{location.port}" unless ["80", "443"].include?(location.port.to_s)
-          newuri += "/"
-          person.url = newuri
-          person.save
-        end
-      end
-      unless response.success?
-        Rails.logger.info("event=http_multi_fail sender_id=#{user_id} recipient_id=#{person.id} url=#{response.effective_url} response_code='#{response.code}' xml='#{Base64.decode64(enc_object_xml)}'")
-        failed_request_people << person.id
-      end
-    end
-
-    hydra.queue request
-  end
-  hydra.run
-
-  unless failed_request_people.empty?
-    if retry_count < MAX_RETRIES
-      Resque.enqueue(Job::HttpMulti, user_id, enc_object_xml, failed_request_people, retry_count + 1 )
-    else
-      Rails.logger.info("event=http_multi_abandon sender_id=#{user_id} failed_recipient_ids='[#{person_ids.join(', ')}] xml='#{Base64.decode64(enc_object_xml)}'")
-    end
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Job/MailMentioned.html b/doc/Job/MailMentioned.html deleted file mode 100644 index 0f91303a974..00000000000 --- a/doc/Job/MailMentioned.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - Class: Job::MailMentioned - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Job::MailMentioned - - - -

- -
- -
Inherits:
-
- Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/jobs/mail_mentioned.rb
- -
-
- - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from Base

-

perform

- - - - - - - - -

Methods included from ResqueJobLogging

-

#application_trace, #around_perform_log_job

- - -
-

Class Method Details

- - -
-

- - + (Object) perform_delegate(recipient_id, actor_id, target_id) - - - -

- - - - -
-
-
-
-9
-10
-11
-12
-13
-
-
# File 'app/models/jobs/mail_mentioned.rb', line 9
-
-def self.perform_delegate(recipient_id, actor_id, target_id)
-  
-  Notifier.mentioned( recipient_id, actor_id, target_id).deliver
-
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Job/ReceiveSalmon.html b/doc/Job/ReceiveSalmon.html deleted file mode 100644 index f4b18a2eacc..00000000000 --- a/doc/Job/ReceiveSalmon.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - Class: Job::ReceiveSalmon - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Job::ReceiveSalmon - - - -

- -
- -
Inherits:
-
- Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/jobs/receive_salmon.rb
- -
-
- - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from Base

-

perform

- - - - - - - - -

Methods included from ResqueJobLogging

-

#application_trace, #around_perform_log_job

- - -
-

Class Method Details

- - -
-

- - + (Object) perform_delegate(user_id, xml) - - - -

- - - - -
-
-
-
-11
-12
-13
-14
-15
-
-
# File 'app/models/jobs/receive_salmon.rb', line 11
-
-def self.perform_delegate(user_id, xml)
-  user = User.find(user_id)
-  zord = Postzord::Receiver.new(user, :salmon_xml => xml)
-  zord.perform
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Job/SocketWebfinger.html b/doc/Job/SocketWebfinger.html deleted file mode 100644 index 58cc69c385b..00000000000 --- a/doc/Job/SocketWebfinger.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - Class: Job::SocketWebfinger - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Job::SocketWebfinger - - - -

- -
- -
Inherits:
-
- Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/jobs/socket_webfinger.rb
- -
-
- - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from Base

-

perform

- - - - - - - - -

Methods included from ResqueJobLogging

-

#application_trace, #around_perform_log_job

- - -
-

Class Method Details

- - -
-

- - + (Object) perform_delegate(user_id, account, opts = {}) - - - -

- - - - -
-
-
-
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-
-
# File 'app/models/jobs/socket_webfinger.rb', line 11
-
-def self.perform_delegate(user_id, , opts={})
-  finger = Webfinger.new()
-  begin
-    result = finger.fetch
-    result.socket_to_user(user_id, opts)
-  rescue
-    Diaspora::WebSocket.queue_to_user(user_id,
-      {:class => 'people',
-       :status => 'fail',
-       :query => ,
-       :response => I18n.t('people.webfinger.fail', :handle => )}.to_json)
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Job/UpdateServiceUsers.html b/doc/Job/UpdateServiceUsers.html deleted file mode 100644 index ac05219fe00..00000000000 --- a/doc/Job/UpdateServiceUsers.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - Class: Job::UpdateServiceUsers - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Job::UpdateServiceUsers - - - -

- -
- -
Inherits:
-
- Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/jobs/update_service_users.rb
- -
-
- - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from Base

-

perform

- - - - - - - - -

Methods included from ResqueJobLogging

-

#application_trace, #around_perform_log_job

- - -
-

Class Method Details

- - -
-

- - + (Object) perform_delegate(service_id) - - - -

- - - - -
-
-
-
-9
-10
-11
-12
-
-
# File 'app/models/jobs/update_service_users.rb', line 9
-
-def self.perform_delegate(service_id)
-  service = Service.find(service_id)
-  service.save_friends
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Like.html b/doc/Like.html deleted file mode 100644 index 4f75be7f59a..00000000000 --- a/doc/Like.html +++ /dev/null @@ -1,540 +0,0 @@ - - - - - - Class: Like - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Like - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - -
Includes:
-
Diaspora::Guid, Diaspora::Relayable, Diaspora::Socketable, Diaspora::Webhooks, ROXML
- - - - - -
Defined in:
-
app/models/like.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Diaspora::Socketable

-

#socket_to_user, #unsocket_from_user

- - - - - - - - -

Methods included from Diaspora::Relayable

-

#after_receive, included, #initialize_signatures, #parent_guid, #parent_guid=, #receive, #relayable?, #signature_valid?, #subscribers, #verify_parent_author_signature

- - - - - - - - -

Methods included from Diaspora::Encryptable

-

#sign_with_key, #signable_accessors, #signable_string, #verify_signature

- - - - - - - - -

Methods included from Diaspora::Guid

-

included, #set_guid

- - - - - - - - -

Methods included from Diaspora::Webhooks

-

#receive, #subscribers, #to_diaspora_xml, #x

- - - - -
-

Instance Method Details

- - -
-

- - - (Object) diaspora_handle - - - -

- - - - -
-
-
-
-24
-25
-26
-
-
# File 'app/models/like.rb', line 24
-
-def diaspora_handle
-  self.author.diaspora_handle
-end
-
-
-
- -
-

- - - (Object) diaspora_handle=(nh) - - - -

- - - - -
-
-
-
-28
-29
-30
-
-
# File 'app/models/like.rb', line 28
-
-def diaspora_handle= nh
-  self.author = Webfinger.new(nh).fetch
-end
-
-
-
- -
-

- - - (Object) notification_type(user, person) - - - -

- - - - -
-
-
-
-44
-45
-46
-
-
# File 'app/models/like.rb', line 44
-
-def notification_type(user, person)
-  Notifications::Liked if self.post.author == user.person && user.person != person
-end
-
-
-
- -
-

- - - (Object) parent - - - -

- - - - -
-
-
-
-36
-37
-38
-
-
# File 'app/models/like.rb', line 36
-
-def parent
-  self.post
-end
-
-
-
- -
-

- - - (Object) parent=(parent) - - - -

- - - - -
-
-
-
-40
-41
-42
-
-
# File 'app/models/like.rb', line 40
-
-def parent= parent
-  self.post = parent
-end
-
-
-
- -
-

- - - (Object) parent_class - - - -

- - - - -
-
-
-
-32
-33
-34
-
-
# File 'app/models/like.rb', line 32
-
-def parent_class
-  Post
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Mention.html b/doc/Mention.html deleted file mode 100644 index 23a4cdb208f..00000000000 --- a/doc/Mention.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - Class: Mention - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Mention - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/mention.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) delete_notification - - - -

- - - - -
-
-
-
-22
-23
-24
-
-
# File 'app/models/mention.rb', line 22
-
-def delete_notification
-  Notification.where(:target_type => self.class.name, :target_id => self.id).delete_all
-end
-
-
-
- -
-

- - - (Object) notification_type(*args) - - - -

- - - - -
-
-
-
-18
-19
-20
-
-
# File 'app/models/mention.rb', line 18
-
-def notification_type(*args)
-  Notifications::Mentioned
-end
-
-
-
- -
-

- - - (Object) notify_recipient - - - -

- - - - -
-
-
-
-13
-14
-15
-16
-
-
# File 'app/models/mention.rb', line 13
-
-def notify_recipient
-  Rails.logger.info "event=mention_sent id=#{self.id} to=#{person.diaspora_handle} from=#{post.author.diaspora_handle}"
-  Notification.notify(person.owner, self, post.author) unless person.remote?
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Message.html b/doc/Message.html deleted file mode 100644 index e8029e04274..00000000000 --- a/doc/Message.html +++ /dev/null @@ -1,674 +0,0 @@ - - - - - - Class: Message - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Message - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - -
Includes:
-
Diaspora::Guid, Diaspora::Relayable, Diaspora::Webhooks, ROXML
- - - - - -
Defined in:
-
app/models/message.rb
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Diaspora::Relayable

-

included, #initialize_signatures, #parent_guid, #parent_guid=, #receive, #relayable?, #signature_valid?, #subscribers, #verify_parent_author_signature

- - - - - - - - -

Methods included from Diaspora::Encryptable

-

#sign_with_key, #signable_accessors, #signable_string, #verify_signature

- - - - - - - - -

Methods included from Diaspora::Webhooks

-

#receive, #subscribers, #to_diaspora_xml, #x

- - - - - - - - -

Methods included from Diaspora::Guid

-

included, #set_guid

- - - - -
-

Instance Method Details

- - -
-

- - - (Object) after_receive(user, person) - - - -

- - - - -
-
-
-
-60
-61
-62
-63
-64
-65
-66
-67
-68
-
-
# File 'app/models/message.rb', line 60
-
-def after_receive(user, person)
-  if vis = ConversationVisibility.where(:conversation_id => self.conversation_id, :person_id => user.person.id).first
-    vis.unread += 1
-    vis.save
-    self
-  else
-    raise NotVisibleException("Attempting to access a ConversationVisibility that does not exist!")
-  end
-end
-
-
-
- -
-

- - - (Object) conversation_guid - - - -

- - - - -
-
-
-
-38
-39
-40
-
-
# File 'app/models/message.rb', line 38
-
-def conversation_guid
-  self.conversation.guid
-end
-
-
-
- -
-

- - - (Object) conversation_guid=(guid) - - - -

- - - - -
-
-
-
-42
-43
-44
-45
-46
-
-
# File 'app/models/message.rb', line 42
-
-def conversation_guid= guid
-  if cnv = Conversation.find_by_guid(guid)
-    self.conversation_id = cnv.id
-  end
-end
-
-
-
- -
-

- - - (Object) diaspora_handle - - - -

- - - - -
-
-
-
-30
-31
-32
-
-
# File 'app/models/message.rb', line 30
-
-def diaspora_handle
-  self.author.diaspora_handle
-end
-
-
-
- -
-

- - - (Object) diaspora_handle=(nh) - - - -

- - - - -
-
-
-
-34
-35
-36
-
-
# File 'app/models/message.rb', line 34
-
-def diaspora_handle= nh
-  self.author = Webfinger.new(nh).fetch
-end
-
-
-
- -
-

- - - (Object) notification_type(user, person) - - - -

- - - - -
-
-
-
-70
-71
-72
-
-
# File 'app/models/message.rb', line 70
-
-def notification_type(user, person)
-  Notifications::PrivateMessage unless user.person == person
-end
-
-
-
- -
-

- - - (Object) parent - - - -

- - - - -
-
-
-
-52
-53
-54
-
-
# File 'app/models/message.rb', line 52
-
-def parent
-  self.conversation
-end
-
-
-
- -
-

- - - (Object) parent=(parent) - - - -

- - - - -
-
-
-
-56
-57
-58
-
-
# File 'app/models/message.rb', line 56
-
-def parent= parent
-  self.conversation = parent
-end
-
-
-
- -
-

- - - (Object) parent_class - - - -

- - - - -
-
-
-
-48
-49
-50
-
-
# File 'app/models/message.rb', line 48
-
-def parent_class
-  Conversation
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/MessagesController.html b/doc/MessagesController.html deleted file mode 100644 index cd87911b3b6..00000000000 --- a/doc/MessagesController.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - Class: MessagesController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: MessagesController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - -
Includes:
-
ApplicationHelper
- - - - - -
Defined in:
-
app/controllers/messages_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from ApplicationHelper

-

#bookmarklet, #direction_for, #get_javascript_strings_for, #hard_link, #how_long_ago, #info_text, #mine?, #object_fields, #object_path, #owner_image_link, #owner_image_tag, #person_image_link, #person_image_tag, #person_link, #post_yield_tag, #profile_photo, #rtl?, #timeago, #type_partial

- - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) create - - - -

- - - - -
-
-
-
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-
-
# File 'app/controllers/messages_controller.rb', line 12
-
-def create
-  cnv = Conversation.joins(:conversation_visibilities).where(:id => params[:conversation_id],
-                            :conversation_visibilities => {:person_id => current_user.person.id}).first
-
-  if cnv
-    message = Message.new(:conversation_id => cnv.id, :text => params[:message][:text], :author => current_user.person)
-    
-    if message.save
-      Rails.logger.info("event=create type=comment user=#{current_user.diaspora_handle} status=success message=#{message.id} chars=#{params[:message][:text].length}")
-      Postzord::Dispatch.new(current_user, message).post
-
-      redirect_to conversations_path(:conversation_id => cnv.id)
-    else
-      render :nothing => true, :status => 422
-    end
-  else
-    render :nothing => true, :status => 422
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Notification.html b/doc/Notification.html deleted file mode 100644 index 76016cd2ca3..00000000000 --- a/doc/Notification.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - - - Class: Notification - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Notification - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - -
Includes:
-
Diaspora::Socketable
- - - - - -
Defined in:
-
app/models/notification.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
-

Direct Known Subclasses

-

Notifications::AlsoCommented, Notifications::CommentOnPost, Notifications::Liked, Notifications::Mentioned, Notifications::PrivateMessage, Notifications::RequestAccepted, Notifications::StartedSharing

-
- - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Diaspora::Socketable

-

#socket_to_user, #unsocket_from_user

- - - -
-

Class Method Details

- - -
-

- - + (Object) for(recipient, opts = {}) - - - -

- - - - -
-
-
-
-14
-15
-16
-
-
# File 'app/models/notification.rb', line 14
-
-def self.for(recipient, opts={})
-  self.where(opts.merge!(:recipient_id => recipient.id)).order('updated_at desc')
-end
-
-
-
- -
-

- - + (Object) notify(recipient, target, actor) - - - -

- - - - -
-
-
-
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-
-
# File 'app/models/notification.rb', line 18
-
-def self.notify(recipient, target, actor)
-  if target.respond_to? :notification_type
-    if note_type = target.notification_type(recipient, actor)
-      if(target.is_a? Comment) || (target.is_a? ) 
-        n = note_type.concatenate_or_create(recipient, target.post, actor, note_type)
-      else
-        n = note_type.make_notification(recipient, target, actor, note_type)
-      end
-      n.(target, actor) if n
-      n.socket_to_user(recipient, :actor => actor) if n
-      n
-     end
-  end
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Object) email_the_user(target, actor) - - - -

- - - - -
-
-
-
-33
-34
-35
-
-
# File 'app/models/notification.rb', line 33
-
-def (target, actor)
-  self.recipient.mail(self.mail_job, self.recipient_id, actor.id, target.id)
-end
-
-
-
- -
-

- - - (Object) mail_job - - - -

-
- - -
-
-
-

Raises:

-
    - -
  • - - - (NotImplementedError) - - - -
  • - -
- -
- - - - -
-
-
-
-38
-39
-40
-
-
# File 'app/models/notification.rb', line 38
-
-def mail_job
-  raise NotImplementedError.new('Subclass this.')
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/NotificationActor.html b/doc/NotificationActor.html deleted file mode 100644 index fc039b6724e..00000000000 --- a/doc/NotificationActor.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Class: NotificationActor - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: NotificationActor - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/notification_actor.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - -
- - - - - \ No newline at end of file diff --git a/doc/Notifications/AlsoCommented.html b/doc/Notifications/AlsoCommented.html deleted file mode 100644 index f59f84b83f0..00000000000 --- a/doc/Notifications/AlsoCommented.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - Class: Notifications::AlsoCommented - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Notifications::AlsoCommented - - - -

- -
- -
Inherits:
-
- Notification - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/notifications/also_commented.rb
- -
-
- - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) mail_job - - - -

- - - - -
-
-
-
-2
-3
-4
-
-
# File 'app/models/notifications/also_commented.rb', line 2
-
-def mail_job
-  Job::MailAlsoCommented
-end
-
-
-
- -
- - - - - -
-
-
-
-5
-6
-7
-
-
# File 'app/models/notifications/also_commented.rb', line 5
-
-def popup_translation_key
-  'notifications.also_commented'
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Notifications/Liked.html b/doc/Notifications/Liked.html deleted file mode 100644 index 4b67513e2e6..00000000000 --- a/doc/Notifications/Liked.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - Class: Notifications::Liked - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Notifications::Liked - - - -

- -
- -
Inherits:
-
- Notification - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/notifications/liked.rb
- -
-
- - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) mail_job - - - -

- - - - -
-
-
-
-2
-3
-4
-
-
# File 'app/models/notifications/liked.rb', line 2
-
-def mail_job
-  Job::MailLiked
-end
-
-
-
- -
- - - - - -
-
-
-
-5
-6
-7
-
-
# File 'app/models/notifications/liked.rb', line 5
-
-def popup_translation_key
-  'notifications.liked'
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Notifications/Mentioned.html b/doc/Notifications/Mentioned.html deleted file mode 100644 index 21262f5981d..00000000000 --- a/doc/Notifications/Mentioned.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - Class: Notifications::Mentioned - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Notifications::Mentioned - - - -

- -
- -
Inherits:
-
- Notification - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/notifications/mentioned.rb
- -
-
- - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) mail_job - - - -

- - - - -
-
-
-
-2
-3
-4
-
-
# File 'app/models/notifications/mentioned.rb', line 2
-
-def mail_job
-  Job::MailMentioned
-end
-
-
-
- -
- - - - - -
-
-
-
-5
-6
-7
-
-
# File 'app/models/notifications/mentioned.rb', line 5
-
-def popup_translation_key
-  'notifications.mentioned'
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Notifications/StartedSharing.html b/doc/Notifications/StartedSharing.html deleted file mode 100644 index 2ebad493aa7..00000000000 --- a/doc/Notifications/StartedSharing.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - Class: Notifications::StartedSharing - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Notifications::StartedSharing - - - -

- -
- -
Inherits:
-
- Notification - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/notifications/started_sharing.rb
- -
-
- - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) email_the_user(target, actor) - - - -

- - - - -
-
-
-
-10
-11
-12
-
-
# File 'app/models/notifications/started_sharing.rb', line 10
-
-def (target, actor)
-  super(target.sender, actor)
-end
-
-
-
- -
-

- - - (Object) mail_job - - - -

- - - - -
-
-
-
-2
-3
-4
-
-
# File 'app/models/notifications/started_sharing.rb', line 2
-
-def mail_job
-  Job::MailStartedSharing
-end
-
-
-
- -
- - - - - -
-
-
-
-6
-7
-8
-
-
# File 'app/models/notifications/started_sharing.rb', line 6
-
-def popup_translation_key
-  'notifications.started_sharing'
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Oink.html b/doc/Oink.html deleted file mode 100644 index 41a6ade24c6..00000000000 --- a/doc/Oink.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - Module: Oink - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Oink - - - -

- -
- - - - - - - - -
Defined in:
-
lib/active_record_instantiation_logs.rb
- -
-
- -

Defined Under Namespace

-

- - - Modules: InstanceTypeCounter, OinkInstanceTypeCounterInstanceMethods - - - - -

- - - - - - -

- Class Method Summary - (collapse) -

- - - - - - -
-

Class Method Details

- - -
-

- - + (Object) extended_active_record! - - - -

- - - - -
-
-
-
-11
-12
-13
-
-
# File 'lib/active_record_instantiation_logs.rb', line 11
-
-def self.extended_active_record!
-  @oink_extended_active_record = true
-end
-
-
-
- -
-

- - + (Boolean) extended_active_record? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-7
-8
-9
-
-
# File 'lib/active_record_instantiation_logs.rb', line 7
-
-def self.extended_active_record?
-  @oink_extended_active_record
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Oink/OinkInstanceTypeCounterInstanceMethods.html b/doc/Oink/OinkInstanceTypeCounterInstanceMethods.html deleted file mode 100644 index dd0b40528ab..00000000000 --- a/doc/Oink/OinkInstanceTypeCounterInstanceMethods.html +++ /dev/null @@ -1,277 +0,0 @@ - - - - - - Module: Oink::OinkInstanceTypeCounterInstanceMethods - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Oink::OinkInstanceTypeCounterInstanceMethods - - - -

- -
- - - - - - - - -
Defined in:
-
lib/active_record_instantiation_logs.rb
- -
-
- - - - - - - -

- Class Method Summary - (collapse) -

- - - - - - -
-

Class Method Details

- - -
-

- - + (Object) included(klass) - - - -

- - - - -
-
-
-
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-
-
# File 'lib/active_record_instantiation_logs.rb', line 49
-
-def self.included(klass)
-  klass.class_eval do
-
-    @@instantiated = {}
-    @@total = nil
-    @@time = 0.0
-
-    def self.reset_instance_type_count
-      @@time = 0.0
-      @@instantiated = {}
-      @@total = nil
-    end
-
-    def self.increment_instance_type_count(time)
-      @@instantiated[base_class.name] ||= 0
-      @@instantiated[base_class.name] += 1
-      @@time += time
-    end
-
-    def self.instantiated_hash
-      @@instantiated
-    end
-
-    def self.instantiation_time
-      @@time
-    end
-
-    def self.total_objects_instantiated
-      @@total ||= @@instantiated.values.sum
-    end
-
-    unless Oink.extended_active_record?
-      class << self
-        alias_method :instantiate_before_oink, :instantiate
-
-        def instantiate(*args, &block)
-          value = nil
-          time = Benchmark.realtime{
-            value = instantiate_before_oink(*args, &block)
-          }*1000
-          increment_instance_type_count(time)
-          value
-        end
-      end
-
-      alias_method :initialize_before_oink, :initialize
-
-      def initialize(*args, &block)
-        value = nil
-        time = Benchmark.realtime{
-          value = initialize_before_oink(*args, &block)
-        }*1000
-        self.class.increment_instance_type_count(time)
-        value
-      end
-
-      Oink.extended_active_record!
-    end
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/PeopleHelper.html b/doc/PeopleHelper.html deleted file mode 100644 index 1f5b967758d..00000000000 --- a/doc/PeopleHelper.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - Module: PeopleHelper - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: PeopleHelper - - - -

- -
- - - - - - - - -
Defined in:
-
app/helpers/people_helper.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) birthday_format(bday) - - - -

- - - - -
-
-
-
-23
-24
-25
-26
-27
-28
-29
-
-
# File 'app/helpers/people_helper.rb', line 23
-
-def birthday_format(bday)
-  if bday.year == 1000
-    I18n.l bday, :format => I18n.t('date.formats.birthday')
-  else
-    I18n.l bday, :format => I18n.t('date.formats.birthday_with_year')
-  end
-end
-
-
-
- -
-

- - - (Object) request_partial(single_aspect_form) - - - -

- - - - -
-
-
-
-7
-8
-9
-10
-11
-12
-13
-
-
# File 'app/helpers/people_helper.rb', line 7
-
-def request_partial single_aspect_form
-  if single_aspect_form
-    'requests/new_request_with_aspect_to_person'
-  else
-    'requests/new_request_to_person'
-  end
-end
-
-
-
- -
-

- - - (Object) search_or_index - - - -

- - - - -
-
-
-
-15
-16
-17
-18
-19
-20
-21
-
-
# File 'app/helpers/people_helper.rb', line 15
-
-def search_or_index
-  if params[:q]
-    I18n.t 'people.helper.results_for',:params => params[:q]
-  else
-    I18n.t "people.helper.people_on_pod_are_aware_of"
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Person.html b/doc/Person.html deleted file mode 100644 index 19821ef50a8..00000000000 --- a/doc/Person.html +++ /dev/null @@ -1,1658 +0,0 @@ - - - - - - Class: Person - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Person - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - -
Includes:
-
Diaspora::Guid, Diaspora::Socketable, Encryptor::Public, ROXML
- - - - - -
Defined in:
-
app/models/person.rb
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Diaspora::Guid

-

included, #set_guid

- - - - - - - - -

Methods included from Diaspora::Socketable

-

#socket_to_user, #unsocket_from_user

- - - - - - - - -

Methods included from Encryptor::Public

-

#aes_encrypt, #encrypt, #encrypt_aes_key, #gen_aes_key

- - - - -
-

Class Method Details

- - -
-

- - + (Object) by_account_identifier(identifier) - - - -

-
-

-database calls -

- - -
-
-
- -
- - - - -
-
-
-
-153
-154
-155
-156
-
-
# File 'app/models/person.rb', line 153
-
-def self.(identifier)
-  identifier = identifier.strip.downcase.gsub('acct:', '')
-  self.where(:diaspora_handle => identifier).first
-end
-
-
-
- -
-

- - + (Object) create_from_webfinger(profile, hcard) - - - -

- - - - -
-
-
-
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-174
-175
-176
-177
-178
-
-
# File 'app/models/person.rb', line 163
-
-def self.create_from_webfinger(profile, hcard)
-  return nil if profile.nil? || !profile.valid_diaspora_profile?
-  new_person = Person.new
-  new_person.serialized_public_key = profile.public_key
-  new_person.guid = profile.guid
-  new_person.diaspora_handle = profile.
-  new_person.url = profile.seed_location
-
-  #hcard_profile = HCard.find profile.hcard.first[:href]
-  Rails.logger.info("event=webfinger_marshal valid=#{new_person.valid?} target=#{new_person.diaspora_handle}")
-  new_person.url = hcard[:url]
-  new_person.assign_new_profile_from_hcard(hcard)
-  new_person.save!
-  new_person.profile.save!
-  new_person
-end
-
-
-
- -
-

- - + (Object) local_by_account_identifier(identifier) - - - -

- - - - -
-
-
-
-158
-159
-160
-161
-
-
# File 'app/models/person.rb', line 158
-
-def self.(identifier)
-  person = self.(identifier)
- (person.nil? || person.remote?) ? nil : person
-end
-
-
-
- -
-

- - + (Object) name_from_attrs(first_name, last_name, diaspora_handle) - - - -

- - - - -
-
-
-
-94
-95
-96
-
-
# File 'app/models/person.rb', line 94
-
-def self.name_from_attrs(first_name, last_name, diaspora_handle)
-  first_name.blank? ? diaspora_handle : "#{first_name.to_s} #{last_name.to_s}"
-end
-
-
-
- -
-

- - + (Object) public_search(query, opts = {}) - - - -

- - - - -
-
-
-
-81
-82
-83
-84
-85
-
-
# File 'app/models/person.rb', line 81
-
-def self.public_search(query, opts={})
-  return [] if query.to_s.blank? || query.to_s.length < 3
-  sql, tokens = self.search_query_string(query)
-  Person.searchable.where(sql, *tokens)
-end
-
-
-
- -
-

- - + (Object) search(query, user) - - - -

- - - - -
-
-
-
-70
-71
-72
-73
-74
-75
-76
-77
-78
-
-
# File 'app/models/person.rb', line 70
-
-def self.search(query, user)
-  return [] if query.to_s.blank? || query.to_s.length < 3
-
-  sql, tokens = self.search_query_string(query)
-  Person.searchable.where(sql, *tokens).joins(
-    "LEFT OUTER JOIN `contacts` ON `contacts`.user_id = #{user.id} AND `contacts`.person_id = `people`.id"
-  ).includes(:profile
-  ).order("contacts.user_id DESC", "profiles.last_name ASC", "profiles.first_name ASC")
-end
-
-
-
- -
-

- - + (Object) search_query_string(query) - - - -

- - - - -
-
-
-
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-
-
# File 'app/models/person.rb', line 46
-
-def self.search_query_string(query)
-  where_clause = "profiles.first_name LIKE ? OR\nprofiles.last_name LIKE ? OR\npeople.diaspora_handle LIKE ? OR\nprofiles.first_name LIKE ? OR\nprofiles.last_name LIKE ?\n"
-  sql = ""
-  tokens = []
-
-  query_tokens = query.to_s.strip.split(" ")
-  query_tokens.each_with_index do |raw_token, i|
-    token = "#{raw_token}%"
-    up_token = "#{raw_token.titleize}%"
-    sql << " OR " unless i == 0
-    sql << where_clause
-    tokens.concat([token, token, token])
-    tokens.concat([up_token, up_token])
-  end
-  [sql, tokens]
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Object) as_json(opts = {}) - - - -

- - - - -
-
-
-
-196
-197
-198
-199
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-
-
# File 'app/models/person.rb', line 196
-
-def as_json(opts={})
-  opts ||= {}
-  if(opts[:format] == :twitter)
-    {
-      :id => self.guid,
-      :screen_name => self.diaspora_handle,
-      :name => self.name,
-      :created_at => self.created_at,
-      :profile_image_url => self.profile.image_url(:thumb_small),
-      :profile => self.profile.as_json(opts)
-    }
-  else
-    {:id => self.guid,
-     :name => self.name,
-     :avatar => self.profile.image_url(:thumb_small),
-     :handle => self.diaspora_handle,
-     :url => "/people/#{self.id}"}
-  end
-end
-
-
-
- -
-

- - - (Object) assign_new_profile_from_hcard(hcard) - - - -

- - - - -
-
-
-
-180
-181
-182
-183
-184
-185
-186
-187
-
-
# File 'app/models/person.rb', line 180
-
-def assign_new_profile_from_hcard(hcard)
-  self.profile = Profile.new(:first_name => hcard[:given_name],
-                            :last_name  => hcard[:family_name],
-                            :image_url  => hcard[:photo],
-                            :image_url_medium  => hcard[:photo_medium],
-                            :image_url_small  => hcard[:photo_small],
-                            :searchable => hcard[:searchable])
-end
-
-
-
- -
-

- - - (Object) downcase_diaspora_handle - - - -

- - - - -
-
-
-
-24
-25
-26
-
-
# File 'app/models/person.rb', line 24
-
-def downcase_diaspora_handle
-  diaspora_handle.downcase! unless diaspora_handle.blank?
-end
-
-
-
- -
-

- - - (Object) exported_key - - - -

- - - - -
-
-
-
-143
-144
-145
-
-
# File 'app/models/person.rb', line 143
-
-def exported_key
-  serialized_public_key
-end
-
-
-
- -
-

- - - (Object) exported_key=(new_key) - - - -

- - - - -
-
-
-
-147
-148
-149
-150
-
-
# File 'app/models/person.rb', line 147
-
-def exported_key= new_key
-  raise "Don't change a key" if serialized_public_key
-  serialized_public_key = new_key
-end
-
-
-
- -
-

- - - (Object) first_name - - - -

- - - - -
-
-
-
-98
-99
-100
-101
-102
-103
-104
-
-
# File 'app/models/person.rb', line 98
-
-def first_name
-  @first_name ||= if profile.nil? || profile.first_name.nil? || profile.first_name.blank?
-              self.diaspora_handle.split('@').first
-            else
-              profile.first_name.to_s
-            end
-end
-
-
-
- -
-

- - - (Boolean) has_photos? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-219
-220
-221
-
-
# File 'app/models/person.rb', line 219
-
-def has_photos?
-  self.posts.where(:type => "Photo").exists?
-end
-
-
-
- -
-

- - - (Boolean) local? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-192
-193
-194
-
-
# File 'app/models/person.rb', line 192
-
-def local?
-  !remote?
-end
-
-
-
- -
-

- - - (Object) name(opts = {}) - - - -

- - - - -
-
-
-
-87
-88
-89
-90
-91
-92
-
-
# File 'app/models/person.rb', line 87
-
-def name(opts = {})
-  if self.profile.nil?
-    fix_profile
-  end
-  @name ||= Person.name_from_attrs(self.profile.first_name, self.profile.last_name, self.diaspora_handle)
-end
-
-
-
- -
-

- - - (Boolean) owns?(obj) - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-106
-107
-108
-
-
# File 'app/models/person.rb', line 106
-
-def owns?(obj)
-  self == obj.author
-end
-
-
-
- -
-

- - - (Object) public_key - - - -

- - - - -
-
-
-
-139
-140
-141
-
-
# File 'app/models/person.rb', line 139
-
-def public_key
-  OpenSSL::PKey::RSA.new(serialized_public_key)
-end
-
-
-
- -
-

- - - (Object) public_key_hash - - - -

- - - - -
-
-
-
-135
-136
-137
-
-
# File 'app/models/person.rb', line 135
-
-def public_key_hash
-  Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s
-end
-
-
-
- -
-

- - - (Object) public_url - - - -

- - - - -
-
-
-
-126
-127
-128
-129
-130
-131
-132
-133
-
-
# File 'app/models/person.rb', line 126
-
-def public_url
-  if self.owner
-    username = self.owner.username
-  else
-    username = self.diaspora_handle.split("@")[0]
-  end
-  "#{url}public/#{username}"
-end
-
-
-
- -
-

- - - (Object) receive_url - - - -

- - - - -
-
-
-
-122
-123
-124
-
-
# File 'app/models/person.rb', line 122
-
-def receive_url
-  "#{url}receive/users/#{self.guid}/"
-end
-
-
-
- -
-

- - - (Boolean) remote? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-189
-190
-191
-
-
# File 'app/models/person.rb', line 189
-
-def remote?
-  owner_id.nil?
-end
-
-
-
- -
-

- - - (Object) to_twitter(format = :json) - - - -

- - - - -
-
-
-
-216
-217
-
-
# File 'app/models/person.rb', line 216
-
-def to_twitter(format=:json)
-end
-
-
-
- -
-

- - - (Object) url - - - -

- - - - -
-
-
-
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-
-
# File 'app/models/person.rb', line 110
-
-def url
-  begin
-    uri = URI.parse(@attributes['url'])
-    url = "#{uri.scheme}://#{uri.host}"
-    url += ":#{uri.port}" unless ["80", "443"].include?(uri.port.to_s)
-    url += "/"
-  rescue Exception => e
-    url = @attributes['url']
-  end
-  url
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Photo.html b/doc/Photo.html deleted file mode 100644 index 65d0e001bf9..00000000000 --- a/doc/Photo.html +++ /dev/null @@ -1,979 +0,0 @@ - - - - - - Class: Photo - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Photo - - - -

- -
- -
Inherits:
-
- Post - -
    -
  • Object
  • - - - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/photo.rb
- -
-
- -

Overview

-
-

-Copyright © 2009, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from Post

-

#activity_streams?, #diaspora_handle, #diaspora_handle=, #receive, #subscribers, #user_refs

- - - - - - - - -

Methods included from Diaspora::Guid

-

included, #set_guid

- - - - - - - - -

Methods included from Diaspora::Webhooks

-

#receive, #subscribers, #to_diaspora_xml, #x

- - - - - - - - - -

Methods included from ApplicationHelper

-

#bookmarklet, #direction_for, #get_javascript_strings_for, #hard_link, #how_long_ago, #info_text, #mine?, #object_fields, #object_path, #owner_image_link, #owner_image_tag, #person_image_link, #person_image_tag, #person_link, #post_yield_tag, #profile_photo, #rtl?, #timeago, #type_partial

- - - -
-

Class Method Details

- - -
-

- - + (Object) diaspora_initialize(params = {}) - - - -

- - - - -
-
-
-
-33
-34
-35
-36
-37
-38
-39
-40
-
-
# File 'app/models/photo.rb', line 33
-
-def self.diaspora_initialize(params = {})
-  photo = super(params)
-  image_file = params.delete(:user_file)
-  photo.random_string = ActiveSupport::SecureRandom.hex(10)
-  photo.unprocessed_image.store! image_file
-  photo.update_remote_path
-  photo
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Object) as_json(opts = {}) - - - -

- - - - -
-
-
-
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-
-
# File 'app/models/photo.rb', line 101
-
-def as_json(opts={})
-  {
-  :photo => {
-    :id => self.id,
-      :url => self.url,
-      :thumb_small => self.url(:thumb_small),
-      :text => self.text
-    }
-  }
-end
-
-
-
- -
-

- - - (Object) ensure_user_picture - - - -

- - - - -
-
-
-
-75
-76
-77
-78
-79
-80
-81
-
-
# File 'app/models/photo.rb', line 75
-
-def ensure_user_picture
-  profiles = Profile.where(:image_url => url(:thumb_large))
-  profiles.each { |profile|
-    profile.image_url = nil
-    profile.save
-  }
-end
-
-
-
- -
-

- - - (Boolean) mutable? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-97
-98
-99
-
-
# File 'app/models/photo.rb', line 97
-
-def mutable?
-  true
-end
-
-
-
- -
-

- - - (Boolean) not_processed? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-42
-43
-44
-
-
# File 'app/models/photo.rb', line 42
-
-def not_processed?
-  processed_image.path.nil?
-end
-
-
-
- -
-

- - - (Object) ownership_of_status_message - - - -

- - - - -
-
-
-
-24
-25
-26
-27
-28
-29
-30
-31
-
-
# File 'app/models/photo.rb', line 24
-
-def ownership_of_status_message
-  message = StatusMessage.find_by_guid(self.status_message_guid)
-  if self.status_message_guid && message
-    self.diaspora_handle == message.diaspora_handle
-  else
-    true
-  end
-end
-
-
-
- -
-

- - - (Object) process - - - -

- - - - -
-
-
-
-91
-92
-93
-94
-95
-
-
# File 'app/models/photo.rb', line 91
-
-def process
-  return false if self.processed? || (!unprocessed_image.path.nil? && unprocessed_image.path.include?('.gif'))
-  processed_image.store!(unprocessed_image) #Ultra naive
-  save!
-end
-
-
-
- -
-

- - - (Boolean) processed? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-46
-47
-48
-
-
# File 'app/models/photo.rb', line 46
-
-def processed?
-  !processed_image.path.nil?
-end
-
-
-
- -
-

- - - (Object) queue_processing_job - - - -

- - - - -
-
-
-
-87
-88
-89
-
-
# File 'app/models/photo.rb', line 87
-
-def queue_processing_job
-  Resque.enqueue(Job::ProcessPhoto, self.id)
-end
-
-
-
- -
-

- - - (Object) thumb_hash - - - -

- - - - -
-
-
-
-83
-84
-85
-
-
# File 'app/models/photo.rb', line 83
-
-def thumb_hash
-  {:thumb_url => url(:thumb_medium), :id => id, :album_id => nil}
-end
-
-
-
- -
-

- - - (Object) update_remote_path - - - -

- - - - -
-
-
-
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-
-
# File 'app/models/photo.rb', line 50
-
-def update_remote_path
-  unless self.unprocessed_image.url.match(/^https?:\/\//)
-    pod_url = AppConfig[:pod_url].dup
-    pod_url.chop! if AppConfig[:pod_url][-1,1] == '/'
-    remote_path = "#{pod_url}#{self.unprocessed_image.url}"
-  else
-    remote_path = self.unprocessed_image.url
-  end
-
-  name_start = remote_path.rindex '/'
-  self.remote_photo_path = "#{remote_path.slice(0, name_start)}/"
-  self.remote_photo_name = remote_path.slice(name_start + 1, remote_path.length)
-end
-
-
-
- -
-

- - - (Object) url(name = nil) - - - -

- - - - -
-
-
-
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-
-
# File 'app/models/photo.rb', line 64
-
-def url(name = nil)
-  if remote_photo_path
-    name = name.to_s + '_' if name
-    remote_photo_path + name.to_s + remote_photo_name
-  elsif not_processed?
-    unprocessed_image.url(name)
-  else
-    processed_image.url(name)
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/PhotosController.html b/doc/PhotosController.html deleted file mode 100644 index 6ba55eb92d9..00000000000 --- a/doc/PhotosController.html +++ /dev/null @@ -1,847 +0,0 @@ - - - - - - Class: PhotosController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: PhotosController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/photos_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) create - - - -

- - - - -
-
-
-
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-90
-
-
# File 'app/controllers/photos_controller.rb', line 40
-
-def create
-  begin
-    raise unless params[:photo][:aspect_ids]
-
-    if params[:photo][:aspect_ids] == "all"
-      params[:photo][:aspect_ids] = current_user.aspects.collect{|x| x.id}
-    elsif params[:photo][:aspect_ids].is_a?(Hash)
-      params[:photo][:aspect_ids] = params[:photo][:aspect_ids].values
-    end
-
-    params[:photo][:user_file] = file_handler(params)
-
-    @photo = current_user.build_post(:photo, params[:photo])
-
-    if @photo.save
-
-      aspects = current_user.aspects_from_ids(params[:photo][:aspect_ids])
-
-      unless @photo.pending
-        current_user.add_to_streams(@photo, aspects)
-        current_user.dispatch_post(@photo, :to => params[:photo][:aspect_ids])
-      end
-
-      if params[:photo][:set_profile_photo]
-        profile_params = {:image_url => @photo.url(:thumb_large),
-                         :image_url_medium => @photo.url(:thumb_medium),
-                         :image_url_small => @photo.url(:thumb_small)}
-        current_user.update_profile(profile_params)
-      end
-
-      respond_to do |format|
-        format.json{ render(:layout => false , :json => {"success" => true, "data" => @photo}.to_json )}
-      end
-    else
-      respond_with @photo, :location => photos_path, :error => message
-    end
-
-  rescue TypeError
-    message = I18n.t 'photos.create.type_error'
-    respond_with @photo, :location => photos_path, :error => message
-
-  rescue CarrierWave::IntegrityError
-    message = I18n.t 'photos.create.integrity_error'
-    respond_with @photo, :location => photos_path, :error => message
-
-  rescue RuntimeError => e
-    message = I18n.t 'photos.create.runtime_error'
-    respond_with @photo, :location => photos_path, :error => message
-    raise e
-  end
-end
-
-
-
- -
-

- - - (Object) destroy - - - -

- - - - -
-
-
-
-118
-119
-120
-121
-122
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-134
-135
-136
-137
-138
-
-
# File 'app/controllers/photos_controller.rb', line 118
-
-def destroy
-  photo = current_user.posts.where(:id => params[:id]).first
-
-  if photo
-    current_user.retract(photo)
-
-    respond_to do |format|
-      format.json{ render :nothing => true, :status => 204 }
-      format.html do
-        flash[:notice] = I18n.t 'photos.destroy.notice'
-        if photo.status_message_guid
-          respond_with photo, :location => photo.status_message
-        else
-          respond_with photo, :location => person_photos_path(current_user.person)
-        end
-      end
-    end
-  else
-    respond_with photo, :location => person_photos_path(current_user.person)
-  end
-end
-
-
-
- -
-

- - - (Object) edit - - - -

- - - - -
-
-
-
-175
-176
-177
-178
-179
-180
-181
-
-
# File 'app/controllers/photos_controller.rb', line 175
-
-def edit
-  if @photo = current_user.posts.where(:id => params[:id]).first
-    respond_with @photo
-  else
-    redirect_to person_photos_path(current_user.person)
-  end
-end
-
-
-
- -
-

- - - (Object) index - - - -

- - - - -
-
-
-
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-
-
# File 'app/controllers/photos_controller.rb', line 10
-
-def index
-  @post_type = :photos
-  @person = Person.find_by_id(params[:person_id])
-
-  if @person
-    @profile = @person.profile
-    @contact = current_user.contact_for(@person)
-    @is_contact = @person != current_user.person && @contact
-    @aspects_with_person = []
-
-    if @contact
-      @aspects_with_person = @contact.aspects
-      @contacts_of_contact = @contact.contacts
-      @contacts_of_contact_count = @contact.contacts.count
-    else
-      @contact = Contact.new
-      @contacts_of_contact = []
-      @contacts_of_contact_count = 0
-    end
-
-    @posts = current_user.posts_from(@person).where(:type => 'Photo').paginate(:page => params[:page])
-
-    render 'people/show'
-
-  else
-    flash[:error] = I18n.t 'people.show.does_not_exist'
-    redirect_to people_path
-  end
-end
-
-
-
- -
-

- - - (Object) make_profile_photo - - - -

- - - - -
-
-
-
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-
-
# File 'app/controllers/photos_controller.rb', line 92
-
-def make_profile_photo
-  author_id = current_user.person.id
-  @photo = Photo.where(:id => params[:photo_id], :author_id => author_id).first
-
-  if @photo
-    profile_hash = {:image_url        => @photo.url(:thumb_large),
-                    :image_url_medium => @photo.url(:thumb_medium),
-                    :image_url_small  => @photo.url(:thumb_small)}
-
-    if current_user.update_profile(profile_hash)
-      respond_to do |format|
-        format.js{ render :json => { :photo_id  => @photo.id,
-                                     :image_url => @photo.url(:thumb_large),
-                                     :image_url_medium => @photo.url(:thumb_medium),
-                                     :image_url_small  => @photo.url(:thumb_small),
-                                     :author_id => author_id},
-                          :status => 201}
-      end
-    else
-      render :nothing => true, :status => 422
-    end
-  else
-    render :nothing => true, :status => 422
-  end
-end
-
-
-
- -
-

- - - (Object) show - - - -

- - - - -
-
-
-
-140
-141
-142
-143
-144
-145
-146
-147
-148
-149
-150
-151
-152
-153
-154
-155
-156
-157
-158
-159
-160
-161
-162
-163
-164
-165
-166
-167
-168
-169
-170
-171
-172
-173
-
-
# File 'app/controllers/photos_controller.rb', line 140
-
-def show
-  @photo = current_user.find_visible_post_by_id(params[:id], :type => 'Photo')
-  if @photo
-    @parent = StatusMessage.where(:guid => @photo.status_message_guid).includes(:photos).first if @photo.status_message_guid
-
-    #if photo is not an attachment, fetch comments for self
-    if @parent
-      @additional_photos = @photo.status_message.photos
-      if @additional_photos
-        @next_photo = @additional_photos[@additional_photos.index(@photo)+1]
-        @prev_photo = @additional_photos[@additional_photos.index(@photo)-1]
-        @next_photo ||= @additional_photos.first
-      end
-    else
-      @parent = @photo
-    end
-
-    @object_aspect_ids = []
-    if @parent_aspects = @parent.aspects.where(:user_id => current_user.id)
-      @object_aspect_ids = @parent_aspects.map{|a| a.id}
-    end
-
-    @ownership = current_user.owns? @photo
-
-    respond_with @photo
-  else
-    begin
-      redirect_to :back
-    rescue
-      redirect_to aspects_path
-    end
-  end
-
-end
-
-
-
- -
-

- - - (Object) update - - - -

- - - - -
-
-
-
-183
-184
-185
-186
-187
-188
-189
-190
-191
-192
-193
-194
-195
-196
-197
-198
-199
-200
-201
-
-
# File 'app/controllers/photos_controller.rb', line 183
-
-def update
-  photo = current_user.posts.where(:id => params[:id]).first
-  if photo
-    if current_user.update_post( photo, params[:photo] )
-      flash.now[:notice] = I18n.t 'photos.update.notice'
-      respond_to do |format|
-        format.js{ render :json => photo, :status => 200 }
-      end
-    else
-      flash.now[:error] = I18n.t 'photos.update.error'
-      respond_to do |format|
-        format.html{ redirect_to [:edit, photo] }
-        format.js{ render :status => 403 }
-      end
-    end
-  else
-    redirect_to person_photos_path(current_user.person)
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/Post.html b/doc/Post.html deleted file mode 100644 index 9a71a49848d..00000000000 --- a/doc/Post.html +++ /dev/null @@ -1,886 +0,0 @@ - - - - - - Class: Post - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Post - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - -
Includes:
-
ApplicationHelper, Diaspora::Guid, Diaspora::Webhooks, ROXML
- - - - - -
Defined in:
-
app/models/post.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
-

Constant Summary

- -
- -
@@per_page = - -
-
10
-
- -
- - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - -
-

Class Method Details

- - -
-

- - + (Object) diaspora_initialize(params) - - - -

- - - - -
-
-
-
-48
-49
-50
-51
-52
-53
-54
-55
-
-
# File 'app/models/post.rb', line 48
-
-def self.diaspora_initialize params
-  new_post = self.new params.to_hash
-  new_post.author = params[:author]
-  new_post.public = params[:public] if params[:public]
-  new_post.pending = params[:pending] if params[:pending]
-  new_post.diaspora_handle = new_post.author.diaspora_handle
-  new_post
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Boolean) activity_streams? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-121
-122
-123
-
-
# File 'app/models/post.rb', line 121
-
-def activity_streams?
-  false
-end
-
-
-
- -
-

- - - (Object) as_json(opts = {}) - - - -

- - - - -
-
-
-
-57
-58
-59
-60
-61
-62
-63
-64
-
-
# File 'app/models/post.rb', line 57
-
-def as_json(opts={})
-  {
-      :post => {
-          :id     => self.guid,
-          :author => self.author.as_json,
-      }
-  }
-end
-
-
-
- -
-

- - - (Object) diaspora_handle - - - -

- - - - -
-
-
-
-32
-33
-34
-
-
# File 'app/models/post.rb', line 32
-
-def diaspora_handle
-  read_attribute(:diaspora_handle) || self.author.diaspora_handle
-end
-
-
-
- -
-

- - - (Object) diaspora_handle=(nd) - - - -

- - - - -
-
-
-
-43
-44
-45
-46
-
-
# File 'app/models/post.rb', line 43
-
-def diaspora_handle= nd
-  self.author = Person.where(:diaspora_handle => nd).first
-  write_attribute(:diaspora_handle, nd)
-end
-
-
-
- -
-

- - - (Boolean) mutable? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-66
-67
-68
-
-
# File 'app/models/post.rb', line 66
-
-def mutable?
-  false
-end
-
-
-
- -
-

- - - (void) receive(user, person) - - - -

-
-

This method returns an undefined value.

- -
-
-
-

Parameters:

-
    - -
  • - - user - - - (User) - - - - — -

    -The user that is receiving this post. -

    -
    - -
  • - -
  • - - person - - - (Person) - - - - — -

    -The person who dispatched this post to the -

    -
    - -
  • - -
- -
- - - - -
-
-
-
-85
-86
-87
-88
-89
-90
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-104
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-
-
# File 'app/models/post.rb', line 85
-
-def receive(user, person)
-  #exists locally, but you dont know about it
-  #does not exsist locally, and you dont know about it
-  #exists_locally?
-  #you know about it, and it is mutable
-  #you know about it, and it is not mutable
-
-  local_post = Post.where(:guid => self.guid).first
-  if local_post && local_post.author_id == self.author_id
-    known_post = user.visible_posts.where(:guid => self.guid).first
-    if known_post
-      if known_post.mutable?
-        known_post.update_attributes(self.attributes)
-      else
-        Rails.logger.info("event=receive payload_type=#{self.class} update=true status=abort sender=#{self.diaspora_handle} reason=immutable existing_post=#{known_post.id}")
-      end
-    else
-      user.contact_for(person).receive_post(local_post)
-      user.notify_if_mentioned(local_post)
-      Rails.logger.info("event=receive payload_type=#{self.class} update=true status=complete sender=#{self.diaspora_handle} existing_post=#{local_post.id}")
-      return local_post
-    end
-  elsif !local_post
-    if self.save
-      user.contact_for(person).receive_post(self)
-      user.notify_if_mentioned(self)
-      Rails.logger.info("event=receive payload_type=#{self.class} update=false status=complete sender=#{self.diaspora_handle}")
-      return self
-    else
-      Rails.logger.info("event=receive payload_type=#{self.class} update=false status=abort sender=#{self.diaspora_handle} reason=#{self.errors.full_messages}")
-    end
-  else
-    Rails.logger.info("event=receive payload_type=#{self.class} update=true status=abort sender=#{self.diaspora_handle} reason='update not from post owner' existing_post=#{self.id}")
-  end
-end
-
-
-
- -
-

- - - (Array<Person>) subscribers(user) - - - -

-
-

-The list of people that should receive this Post. -

- - -
-
-
-

Parameters:

-
    - -
  • - - user - - - (User) - - - - — -

    -The context, or dispatching user. -

    -
    - -
  • - -
-

Returns:

-
    - -
  • - - - (Array<Person>) - - - - — -

    -The list of subscribers to this post -

    -
    - -
  • - -
- -
- - - - -
-
-
-
-74
-75
-76
-77
-78
-79
-80
-
-
# File 'app/models/post.rb', line 74
-
-def subscribers(user)
-  if self.public?
-    user.contact_people
-  else
-    user.people_in_aspects(user.aspects_with_post(self.id))
-  end
-end
-
-
-
- -
-

- - - (Object) user_refs - - - -

- - - - -
-
-
-
-35
-36
-37
-38
-39
-40
-41
-
-
# File 'app/models/post.rb', line 35
-
-def user_refs
-  if AspectVisibility.exists?(:post_id => self.id)
-    self.post_visibilities.count + 1
-  else
-    self.post_visibilities.count
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/PostsController.html b/doc/PostsController.html deleted file mode 100644 index d62977a5437..00000000000 --- a/doc/PostsController.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - Class: PostsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: PostsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/posts_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) show - - - -

- - - - -
-
-
-
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-
-
# File 'app/controllers/posts_controller.rb', line 10
-
-def show
-  @post = Post.where(:id => params[:id], :public => true).includes(:author, :comments => :author).first
-
-  if @post
-    @landing_page = true
-    @person = @post.author
-    if @person.owner_id
-      I18n.locale = @person.owner.language
-      render "posts/#{@post.class.to_s.underscore}", :layout => true
-    else
-      flash[:error] = I18n.t('posts.doesnt_exist')
-      redirect_to root_url
-    end
-  else
-    flash[:error] = I18n.t('posts.doesnt_exist')
-    redirect_to root_url
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/PostsFake.html b/doc/PostsFake.html deleted file mode 100644 index 27be032d5d4..00000000000 --- a/doc/PostsFake.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - - - Class: PostsFake - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: PostsFake - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
lib/fake.rb
- -
-
- -

Defined Under Namespace

-

- - - - - Classes: Fake - - -

- - -

Instance Attribute Summary (collapse)

- - - - - - -

- Instance Method Summary - (collapse) -

- - - - -
-

Constructor Details

- -
-

- - - (PostsFake) initialize(posts) - - - -

-
-

-A new instance of PostsFake -

- - -
-
-
- -
- - - - -
-
-
-
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-
-
# File 'lib/fake.rb', line 5
-
-def initialize(posts)
-  author_ids = []
-  posts.each do |p|
-    author_ids << p.author_id
-    p.comments.each do |c|
-      author_ids << c.author_id
-    end
-  end
-
-  people = Person.where(:id => author_ids).includes(:profile)
-  @people_hash = {}
-  people.each{|person| @people_hash[person.id] = person}
-
-  @post_fakes = posts.map do |post|
-    f = Fake.new(post, self)
-    f.comments = post.comments.map do |comment|
-      Fake.new(comment, self)
-    end
-    f
-  end
-end
-
-
-
- -
- -
-

Instance Attribute Details

- - - - -
-

- - - (Object) people_hash (readonly) - - - -

-
-

-Returns the value of attribute people_hash -

- - -
-
-
- -
- - - - -
-
-
-
-2
-3
-4
-
-
# File 'lib/fake.rb', line 2
-
-def people_hash
-  @people_hash
-end
-
-
-
- - - - -
-

- - - (Object) post_fakes (readonly) - - - -

-
-

-Returns the value of attribute post_fakes -

- - -
-
-
- -
- - - - -
-
-
-
-2
-3
-4
-
-
# File 'lib/fake.rb', line 2
-
-def post_fakes
-  @post_fakes
-end
-
-
-
- -
- - -
-

Instance Method Details

- - -
-

- - - (Object) models - - - -

- - - - -
-
-
-
-27
-28
-29
-
-
# File 'lib/fake.rb', line 27
-
-def models
-  self.post_fakes.map{|a| a.model }
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/PostsFake/Fake.html b/doc/PostsFake/Fake.html deleted file mode 100644 index 97de69cfa4f..00000000000 --- a/doc/PostsFake/Fake.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - - - Class: PostsFake::Fake - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: PostsFake::Fake - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
lib/fake.rb
- -
-
- - - -

Instance Attribute Summary (collapse)

- - - - - - -

- Instance Method Summary - (collapse) -

- - - - -
-

Constructor Details

- -
-

- - - (Fake) initialize(model, fakes_collection) - - - -

-
-

-A new instance of Fake -

- - -
-
-
- -
- - - - -
-
-
-
-34
-35
-36
-37
-
-
# File 'lib/fake.rb', line 34
-
-def initialize(model, fakes_collection)
-  @fakes_collection = fakes_collection
-  @model = model
-end
-
-
-
- -
-
-

Dynamic Method Handling

-

- This class handles dynamic methods through the method_missing method - -

- -
-

- - - (Object) method_missing(method, *args) - - - -

- - - - -
-
-
-
-55
-56
-57
-
-
# File 'lib/fake.rb', line 55
-
-def method_missing(method, *args)
-  @model.send(method, *args)
-end
-
-
-
- -
- -
-

Instance Attribute Details

- - - - -
-

- - - (Object) comments - - - -

-
-

-Returns the value of attribute comments -

- - -
-
-
- -
- - - - -
-
-
-
-32
-33
-34
-
-
# File 'lib/fake.rb', line 32
-
-def comments
-  @comments
-end
-
-
-
- - - - -
-

- - - (Object) model (readonly) - - - -

-
-

-Returns the value of attribute model -

- - -
-
-
- -
- - - - -
-
-
-
-33
-34
-35
-
-
# File 'lib/fake.rb', line 33
-
-def model
-  @model
-end
-
-
-
- -
- - -
-

Instance Method Details

- - -
-

- - - (Object) author - - - -

- - - - -
-
-
-
-47
-48
-49
-
-
# File 'lib/fake.rb', line 47
-
-def author
-  @fakes_collection.people_hash[@model.author_id]
-end
-
-
-
- -
-

- - - (Object) id - - - -

- - - - -
-
-
-
-39
-40
-41
-
-
# File 'lib/fake.rb', line 39
-
-def id
-  @model.id
-end
-
-
-
- -
-

- - - (Boolean) respond_to?(*args) - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-51
-52
-53
-
-
# File 'lib/fake.rb', line 51
-
-def respond_to?(*args)
-  super(*args) || model.respond_to?(*args)
-end
-
-
-
- -
-

- - - (Object) to_s - - - -

- - - - -
-
-
-
-43
-44
-45
-
-
# File 'lib/fake.rb', line 43
-
-def to_s
-  @model.id.to_s
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/ProcessedImage.html b/doc/ProcessedImage.html deleted file mode 100644 index 34f8892b1b9..00000000000 --- a/doc/ProcessedImage.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - Class: ProcessedImage - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: ProcessedImage - - - -

- -
- -
Inherits:
-
- CarrierWave::Uploader::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - -
Includes:
-
CarrierWave::MiniMagick
- - - - - -
Defined in:
-
app/uploaders/processed_image.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) extension_white_list - - - -

- - - - -
-
-
-
-12
-13
-14
-
-
# File 'app/uploaders/processed_image.rb', line 12
-
-def extension_white_list
-  %w(jpg jpeg png gif)
-end
-
-
-
- -
-

- - - (Object) filename - - - -

- - - - -
-
-
-
-16
-17
-18
-
-
# File 'app/uploaders/processed_image.rb', line 16
-
-def filename
-  model.random_string + File.extname(@filename) if @filename
-end
-
-
-
- -
-

- - - (Object) store_dir - - - -

- - - - -
-
-
-
-8
-9
-10
-
-
# File 'app/uploaders/processed_image.rb', line 8
-
-def store_dir
-  "uploads/images"
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/PublicsController.html b/doc/PublicsController.html deleted file mode 100644 index 2fe4aa9d478..00000000000 --- a/doc/PublicsController.html +++ /dev/null @@ -1,490 +0,0 @@ - - - - - - Class: PublicsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: PublicsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - -
Includes:
-
Diaspora::Parser
- - - - - -
Defined in:
-
app/controllers/publics_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Diaspora::Parser

-

from_xml

- - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) hcard - - - -

- - - - -
-
-
-
-17
-18
-19
-20
-21
-22
-23
-24
-
-
# File 'app/controllers/publics_controller.rb', line 17
-
-def hcard
-  @person = Person.where(:guid => params[:guid]).first
-  unless @person.nil? || @person.owner.nil?
-    render 'publics/hcard'
-  else
-    render :nothing => true, :status => 404
-  end
-end
-
-
-
- -
-

- - - (Object) host_meta - - - -

- - - - -
-
-
-
-26
-27
-28
-
-
# File 'app/controllers/publics_controller.rb', line 26
-
-def host_meta
-  render 'host_meta', :content_type => 'application/xrd+xml'
-end
-
-
-
- -
-

- - - (Object) hub - - - -

- - - - -
-
-
-
-39
-40
-41
-
-
# File 'app/controllers/publics_controller.rb', line 39
-
-def hub
-  render :text => params['hub.challenge'], :status => 202, :layout => false
-end
-
-
-
- -
-

- - - (Object) receive - - - -

- - - - -
-
-
-
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-
-
# File 'app/controllers/publics_controller.rb', line 43
-
-def receive
-  if params[:xml].nil?
-    render :nothing => true, :status => 422
-    return
-  end
-
-  person = Person.where(:guid => params[:guid]).first
-
-  if person.nil? || person.owner_id.nil?
-    Rails.logger.error("Received post for nonexistent person #{params[:guid]}")
-    render :nothing => true, :status => 404
-    return
-  end
-
-  @user = person.owner
-  Resque.enqueue(Job::ReceiveSalmon, @user.id, CGI::unescape(params[:xml]))
-
-  render :nothing => true, :status => 202
-end
-
-
-
- -
-

- - - (Object) webfinger - - - -

- - - - -
-
-
-
-30
-31
-32
-33
-34
-35
-36
-37
-
-
# File 'app/controllers/publics_controller.rb', line 30
-
-def webfinger
-  @person = Person.(params[:q]) if params[:q]
-  unless @person.nil?
-    render 'webfinger', :content_type => 'application/xrd+xml'
-  else
-    render :nothing => true, :status => 404
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP deleted file mode 100644 index fe41f5cc24d..00000000000 --- a/doc/README_FOR_APP +++ /dev/null @@ -1,2 +0,0 @@ -Use this README file to introduce your application and point to useful places in the API for learning more. -Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. diff --git a/doc/Rails.html b/doc/Rails.html deleted file mode 100644 index a85690a4353..00000000000 --- a/doc/Rails.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - Module: Rails - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: Rails - - - -

- -
- - - - - - - -
Included in:
-
SocketsController
- - - -
Defined in:
-
lib/log_overrider.rb
- -
-
- -

Defined Under Namespace

-

- - - Modules: Rack - - - - -

- - - - - - - -
- - - - - \ No newline at end of file diff --git a/doc/Salmon/SalmonSlap.html b/doc/Salmon/SalmonSlap.html deleted file mode 100644 index 215169ad5ea..00000000000 --- a/doc/Salmon/SalmonSlap.html +++ /dev/null @@ -1,1404 +0,0 @@ - - - - - - Class: Salmon::SalmonSlap - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: Salmon::SalmonSlap - - - -

- -
- -
Inherits:
-
- Object - -
    -
  • Object
  • - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
lib/salmon/salmon.rb
- -
-
- - - -

Instance Attribute Summary (collapse)

- - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - -
-

Instance Attribute Details

- - - - -
-

- - - (Object) aes_key - - - -

-
-

-Returns the value of attribute aes_key -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def aes_key
-  @aes_key
-end
-
-
-
- - - - -
-

- - - (Object) author - - - -

-
-

-Returns the value of attribute author -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-47
-48
-49
-50
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def author
-  if @author.nil?
-    @author ||= Person. @author_email
-    raise "did you remember to async webfinger?" if @author.nil?
-  end
-  @author
-end
-
-
-
- - - - -
-

- - - (Object) author_email - - - -

-
-

-Returns the value of attribute author_email -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def author_email
-  @author_email
-end
-
-
-
- - - - -
-

- - - (Object) data_type - - - -

-
-

-Returns the value of attribute data_type -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def data_type
-  @data_type
-end
-
-
-
- - - - -
-

- - - (Object) iv - - - -

-
-

-Returns the value of attribute iv -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def iv
-  @iv
-end
-
-
-
- - - - -
-

- - - (Object) magic_sig - - - -

-
-

-Returns the value of attribute magic_sig -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def magic_sig
-  @magic_sig
-end
-
-
-
- - - - -
-

- - - (Object) parsed_data - - - -

-
-

-Returns the value of attribute parsed_data -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def parsed_data
-  @parsed_data
-end
-
-
-
- - - - -
-

- - - (Object) sig - - - -

-
-

-Returns the value of attribute sig -

- - -
-
-
- -
- - - - -
-
-
-
-44
-45
-46
-
-
# File 'lib/salmon/salmon.rb', line 44
-
-def sig
-  @sig
-end
-
-
-
- -
- - -
-

Class Method Details

- - -
-

- - + (Object) b64_to_n(str) - - - -

-
-

-Decode a string containing URL safe Base64 into an integer Example: -

-
-  MagicSig.b64_to_n('AQAB')
-  # -> 645537
-
- - -
-
-
- -
- - - - -
-
-
-
-153
-154
-155
-156
-
-
# File 'lib/salmon/salmon.rb', line 153
-
-def self.b64_to_n(str)
-  packed = decode64url(str)
-  packed.unpack('B*')[0].to_i(2)
-end
-
-
-
- -
-

- - + (Object) build_key(n, e) - - - -

-
-

-Take two integers e, n and create a new OpenSSL::PKey::RSA key with them -Example: -

-
-  n = 9487834027867356975347184933768917275269369900665861930617802608089634337052392076689226301419587057117740995382286148368168197915234368486155306558161867
-  e = 65537
-  key = MagicSig.build_key(n,e)
-  key.public_encrypt(...) # for sending to strangers
-  key.public_decrypt(...) # very rarely used
-  key.verify(...) # for verifying signatures
-
- - -
-
-
- -
- - - - -
-
-
-
-180
-181
-182
-183
-184
-185
-
-
# File 'lib/salmon/salmon.rb', line 180
-
-def self.build_key(n,e)
-  key = OpenSSL::PKey::RSA.new
-  key.n = n
-  key.e = e
-  key
-end
-
-
-
- -
-

- - + (Object) create(user, activity) - - - -

- - - - -
-
-
-
-47
-48
-49
-50
-51
-52
-53
-54
-55
-
-
# File 'lib/salmon/salmon.rb', line 47
-
-def self.create(user, activity)
-  salmon = self.new
-  salmon.author = user.person
-  aes_key_hash = user.person.gen_aes_key
-  salmon.aes_key = aes_key_hash['key']
-  salmon.iv      = aes_key_hash['iv']
-  salmon.magic_sig = MagicSigEnvelope.create(user , user.person.aes_encrypt(activity, aes_key_hash))
-  salmon
-end
-
-
-
- -
-

- - + (Object) decode64url(str) - - - -

-
-

-Decode URL-safe-Base64. This implements -

- - -
-
-
- -
- - - - -
-
-
-
-123
-124
-125
-126
-127
-128
-129
-130
-131
-132
-133
-
-
# File 'lib/salmon/salmon.rb', line 123
-
-def self.decode64url(str)
-  # remove whitespace
-  sans_whitespace = str.gsub(/\s/, '')
-  # pad to a multiple of 4
-  string = sans_whitespace + '=' * ((4 - sans_whitespace.size) % 4)
-  # convert to standard Base64
-  # string = padded.tr('-','+').tr('_','/')
-
-  # Base64.decode64(string)
-  Base64.urlsafe_decode64 string
-end
-
-
-
- -
-

- - + (Object) parse(xml, user) - - - -

-
- - -
-
-
-

Raises:

-
    - -
  • - - - (ArgumentError) - - - -
  • - -
- -
- - - - -
-
-
-
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-
-
# File 'lib/salmon/salmon.rb', line 57
-
-def self.parse(xml, user)
-  slap = self.new
-  doc = Nokogiri::XML(xml)
-
-  sig_doc = doc.search('entry')
-
-  ### Header ##
-  decrypted_header = user.decrypt(doc.search('encrypted_header').text)
-  header_doc       = Nokogiri::XML(decrypted_header)
-  slap.author_email= header_doc.search('uri').text.split("acct:").last
-  slap.aes_key     = header_doc.search('aes_key').text
-  slap.iv          = header_doc.search('iv').text
-
-  slap.magic_sig = MagicSigEnvelope.parse sig_doc
-
-  if  'base64url' == slap.magic_sig.encoding
-
-    key_hash = {'key' => slap.aes_key, 'iv' => slap.iv}
-    slap.parsed_data = user.aes_decrypt(decode64url(slap.magic_sig.data), key_hash)
-    slap.sig = slap.magic_sig.sig
-  else
-    raise ArgumentError, "Magic Signature data must be encoded with base64url, was #{slap.magic_sig.encoding}"
-  end
-
-  slap.data_type = slap.magic_sig.data_type
-
-  raise ArgumentError, "Magic Signature data must be signed with RSA-SHA256, was #{slap.magic_sig.alg}" unless 'RSA-SHA256' == slap.magic_sig.alg
-
-  slap
-end
-
-
-
- -
-

- - + (Object) parse_key(str) - - - -

-
-

-Parse a string containing a magic-public-key into an OpenSSL::PKey::RSA -key. Example: -

-
-  key = MagicSig.parse_key('RSA.mVgY8RN6URBTstndvmUUPb4UZTdwvwmddSKE5z_jvKUEK6yk1u3rrC9yN8k6FilGj9K0eeUPe2hf4Pj-5CmHww.AQAB')
-  key.n
-  # -> 8031283789075196565022891546563591368344944062154100509645398892293433370859891943306439907454883747534493461257620351548796452092307094036643522661681091
-  key.e
-  # -> 65537
-
- - -
-
-
- -
- - - - -
-
-
-
-166
-167
-168
-169
-
-
# File 'lib/salmon/salmon.rb', line 166
-
-def self.parse_key(str)
-  n,e = str.match(/^RSA.([^.]*).([^.]*)$/)[1..2]
-  build_key(b64_to_n(n),b64_to_n(e))
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Object) decrypted_header - - - -

- - - - -
-
-
-
-100
-101
-102
-
-
# File 'lib/salmon/salmon.rb', line 100
-
-def decrypted_header
-  header ="    <decrypted_header>\n    <iv>\#{iv}</iv>\n    <aes_key>\#{aes_key}</aes_key>\n    <author>\n      <name>\#{@author.name}</name>\n      <uri>acct:\#{@author.diaspora_handle}</uri>\n    </author>\n    </decrypted_header>\n"
-end
-
-
-
- -
-

- - - (Boolean) verified_for_key?(public_key) - - - -

-
-

-Check whether this envelope’s signature can be verified with the -provided OpenSSL::PKey::RSA public_key. Example: -

-
-  env.verified_for_key? OpenSSL::PKey::RSA.new(File.open('public_key.pem'))
-  # -> true
-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-141
-142
-143
-144
-145
-146
-
-
# File 'lib/salmon/salmon.rb', line 141
-
-def verified_for_key?(public_key)
-  signature = Base64.urlsafe_decode64(self.magic_sig.sig)
-  signed_data = self.magic_sig.signable_string# Base64.urlsafe_decode64(self.magic_sig.signable_string)
-
-  public_key.verify(OpenSSL::Digest::SHA256.new, signature, signed_data )
-end
-
-
-
- -
-

- - - (Object) xml_for(person) - - - -

- - - - -
-
-
-
-88
-89
-90
-91
-
-
# File 'lib/salmon/salmon.rb', line 88
-
-def xml_for person
-  xml ="    <?xml version='1.0' encoding='UTF-8'?>\n    <entry xmlns='http://www.w3.org/2005/Atom'>\n    <encrypted_header>\#{person.encrypt(decrypted_header)}</encrypted_header>\n      \#{@magic_sig.to_xml}\n      </entry>\n"
-
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/SessionsController.html b/doc/SessionsController.html deleted file mode 100644 index b68762ee27f..00000000000 --- a/doc/SessionsController.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - Class: SessionsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: SessionsController - - - -

- -
- -
Inherits:
-
- Devise::SessionsController - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/sessions_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - -
- - - - - \ No newline at end of file diff --git a/doc/SocketsController.html b/doc/SocketsController.html deleted file mode 100644 index f4305cccff7..00000000000 --- a/doc/SocketsController.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - Class: SocketsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: SocketsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - -
Includes:
-
ApplicationHelper, Rails, SocketsHelper
- - - - - -
Defined in:
-
app/controllers/sockets_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - - - - - - -

Methods included from SocketsHelper

-

#action_hash, #obj_id

- - - - - - - - -

Methods included from NotificationsHelper

-

#new_notification_link, #notification_message_for, #notification_people_link, #object_link, #peoples_names, #the_day, #the_month, #translation

- - - - - - - - -

Methods included from ApplicationHelper

-

#bookmarklet, #direction_for, #get_javascript_strings_for, #hard_link, #how_long_ago, #info_text, #mine?, #object_fields, #object_path, #owner_image_link, #owner_image_tag, #person_image_link, #person_image_tag, #person_link, #post_yield_tag, #profile_photo, #rtl?, #timeago, #type_partial

- - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) incoming(msg) - - - -

- - - - -
-
-
-
-10
-11
-12
-
-
# File 'app/controllers/sockets_controller.rb', line 10
-
-def incoming(msg)
-  Rails.logger.info("Socket received connection to: #{msg}")
-end
-
-
-
- -
-

- - - (Object) outgoing(user_or_id, object, opts = {}) - - - -

- - - - -
-
-
-
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-
-
# File 'app/controllers/sockets_controller.rb', line 14
-
-def outgoing(user_or_id, object, opts={})
-  if user_or_id.instance_of?(Fixnum)
-    user_id = user_or_id
-  else
-    user_id = user_or_id.id
-    @user = user_or_id
-  end
-  return unless Diaspora::WebSocket.is_connected?(user_id)
-  @_request = ActionDispatch::Request.new({})
-  Diaspora::WebSocket.queue_to_user(user_id, action_hash(@user || User.find(user_id), object, opts))
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/SocketsHelper.html b/doc/SocketsHelper.html deleted file mode 100644 index 7b03366a226..00000000000 --- a/doc/SocketsHelper.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - Module: SocketsHelper - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: SocketsHelper - - - -

- -
- - - - - -
Includes:
-
ApplicationHelper, NotificationsHelper
- - - - -
Included in:
-
SocketsController
- - - -
Defined in:
-
app/helpers/sockets_helper.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from NotificationsHelper

-

#new_notification_link, #notification_message_for, #notification_people_link, #object_link, #peoples_names, #the_day, #the_month, #translation

- - - - - - - - -

Methods included from ApplicationHelper

-

#bookmarklet, #direction_for, #get_javascript_strings_for, #hard_link, #how_long_ago, #info_text, #mine?, #object_fields, #object_path, #owner_image_link, #owner_image_tag, #person_image_link, #person_image_tag, #person_link, #post_yield_tag, #profile_photo, #rtl?, #timeago, #type_partial

- - -
-

Instance Method Details

- - -
-

- - - (Object) action_hash(user, object, opts = {}) - - - -

- - - - -
-
-
-
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-
-
# File 'app/helpers/sockets_helper.rb', line 19
-
-def action_hash(user, object, opts={})
-  uid = user.id
-  begin
-    unless user.nil?
-      old_locale = I18n.locale
-      I18n.locale = user.language.to_s
-    end
-
-    if object.is_a? StatusMessage
-      post_hash = {:post => object,
-        :author => object.author,
-        :photos => object.photos,
-        :comments => object.comments.map{|c|
-          {:comment => c,
-           :author => c.author
-          }
-      },
-        :current_user => user,
-        :all_aspects => user.aspects,
-      }
-      v = render_to_string(:partial => 'shared/stream_element', :locals => post_hash)
-    elsif object.is_a? Person
-      person_hash = {
-        :single_aspect_form => opts["single_aspect_form"],
-        :person => object,
-        :all_aspects => user.aspects,
-        :contact => user.contact_for(object),
-        :current_user => user}
-      @all_aspects = user.aspects
-      v = render_to_string(:partial => 'people/person', :locals => person_hash)
-
-    elsif object.is_a? Comment
-      v = render_to_string(:partial => 'comments/comment', :locals => {:post => object.post, :comment => object, :person => object.author, :current_user => user})
-
-    elsif object.is_a? 
-      v = render_to_string(:partial => 'likes/likes', :locals => {:likes => object.post., :dislikes => object.post.dislikes})
-
-    elsif object.is_a? Notification
-      v = render_to_string(:partial => 'notifications/popup', :locals => {:note => object, :person => opts[:actor]})
-
-    else
-      raise "#{object.inspect} with class #{object.class} is not actionhashable." unless object.is_a? Retraction
-    end
-  rescue Exception => e
-    Rails.logger.error("event=socket_render status=fail user=#{user.diaspora_handle} object=#{object.id.to_s}")
-    raise e
-  end
-  action_hash = {:class =>object.class.to_s.underscore.pluralize, :html => v, :post_id => obj_id(object)}
-  action_hash.merge! opts
-  if object.is_a? Photo
-    action_hash[:photo_hash] = object.thumb_hash
-  end
-
-  if object.is_a? Comment
-    post = object.post
-    action_hash[:comment_id] = object.id
-    action_hash[:my_post?] = (post.author.owner_id == uid)
-    action_hash[:post_guid] = post.guid
-
-  end
-
-  if object.is_a? 
-    action_hash[:post_guid] = object.post.guid
-  end
-
-  action_hash[:mine?] = object.author && (object.author.owner_id == uid) if object.respond_to?(:author)
-
-  I18n.locale = old_locale unless user.nil?
-
-  action_hash.to_json
-end
-
-
-
- -
-

- - - (Object) obj_id(object) - - - -

- - - - -
-
-
-
-9
-10
-11
-12
-13
-14
-15
-16
-17
-
-
# File 'app/helpers/sockets_helper.rb', line 9
-
-def obj_id(object)
-  if object.respond_to?(:post_id)
-    object.post_id
-  elsif object.respond_to?(:post_guid)
-    object.post_guid
-  else
-    object.id
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/StatusMessagesController.html b/doc/StatusMessagesController.html deleted file mode 100644 index e4b43b83417..00000000000 --- a/doc/StatusMessagesController.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - - - Class: StatusMessagesController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: StatusMessagesController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/status_messages_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) bookmarklet - - - -

- - - - -
-
-
-
-28
-29
-30
-31
-32
-33
-
-
# File 'app/controllers/status_messages_controller.rb', line 28
-
-def bookmarklet
-  @aspects = current_user.aspects
-  @selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq
-  @aspect_ids = @aspects.map{|x| x.id}
-  render :layout => nil
-end
-
-
-
- -
-

- - - (Object) create - - - -

- - - - -
-
-
-
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-72
-73
-74
-75
-76
-77
-78
-79
-80
-81
-82
-83
-84
-85
-86
-87
-88
-89
-
-
# File 'app/controllers/status_messages_controller.rb', line 35
-
-def create
-  params[:status_message][:aspect_ids] = params[:aspect_ids]
-
-  photos = Photo.where(:id => [*params[:photos]], :diaspora_handle => current_user.person.diaspora_handle)
-
-  public_flag = params[:status_message][:public]
-  public_flag.to_s.match(/(true)|(on)/) ? public_flag = true : public_flag = false
-  params[:status_message][:public] = public_flag
-
-  @status_message = current_user.build_post(:status_message, params[:status_message])
-  aspects = current_user.aspects_from_ids(params[:aspect_ids])
-
-  if !photos.empty?
-    @status_message.photos << photos
-  end
-  if @status_message.save
-    Rails.logger.info("event=create type=status_message chars=#{params[:status_message][:text].length}")
-
-    current_user.add_to_streams(@status_message, aspects)
-    receiving_services = params[:services].map{|s| current_user.services.where(
-                                :type => "Services::"+s.titleize).first} if params[:services]
-    current_user.dispatch_post(@status_message, :url => post_url(@status_message), :services => receiving_services)
-    if !photos.empty?
-      for photo in photos
-        was_pending = photo.pending
-        if was_pending
-          current_user.add_to_streams(photo, aspects)
-          current_user.dispatch_post(photo)
-        end
-      end
-      photos.update_all(:pending => false, :public => public_flag)
-    end
-
-    if request.env['HTTP_REFERER'].include?("people")
-      flash[:notice] = t('status_messages.create.success', :names => @status_message.mentions.includes(:person => :profile).map{ |mention| mention.person.name }.join(', '))
-    end
-
-    respond_to do |format|
-      format.js { render :create, :status => 201}
-      format.html { redirect_to :back}
-      format.mobile{ redirect_to root_url}
-    end
-  else
-    if !photos.empty?
-      photos.update_all(:status_message_guid => nil)
-    end
-    respond_to do |format|
-      format.js { 
-        errors = @status_message.errors.full_messages.collect { |msg| msg.gsub(/^Text/, "") }
-        render :json =>{:errors => errors}, :status => 422
-      }
-      format.html {redirect_to :back}
-    end
-  end
-end
-
-
-
- -
-

- - - (Object) destroy - - - -

- - - - -
-
-
-
-91
-92
-93
-94
-95
-96
-97
-98
-99
-100
-101
-102
-103
-
-
# File 'app/controllers/status_messages_controller.rb', line 91
-
-def destroy
-  @status_message = current_user.posts.where(:id => params[:id]).first
-  if @status_message
-    current_user.retract(@status_message)
-    respond_to do |format|
-      format.js {render 'destroy'}
-      format.all {redirect_to root_url}
-    end
-  else
-    Rails.logger.info "event=post_destroy status=failure user=#{current_user.diaspora_handle} reason='User does not own post'"
-    render :nothing => true, :status => 404
-  end
-end
-
-
-
- -
-

- - - (Object) new - - - -

- - - - -
-
-
-
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-
-
# File 'app/controllers/status_messages_controller.rb', line 12
-
-def new
-  @person = Person.find(params[:person_id])
-  @aspect = :profile
-  @contact = current_user.contact_for(@person)
-  @aspects_with_person = []
-  if @contact
-    @aspects_with_person = @contact.aspects
-    @aspect_ids = @aspects_with_person.map(&:id)
-    @contacts_of_contact = @contact.contacts
-
-    render :layout => nil
-  else
-    redirect_to :back
-  end
-end
-
-
-
- -
-

- - - (Object) show - - - -

- - - - -
-
-
-
-105
-106
-107
-108
-109
-110
-111
-112
-113
-114
-115
-116
-117
-118
-119
-120
-121
-122
-
-
# File 'app/controllers/status_messages_controller.rb', line 105
-
-def show
-  @status_message = current_user.find_visible_post_by_id params[:id]
-  if @status_message
-    @object_aspect_ids = @status_message.aspects.map{|a| a.id}
-
-    # mark corresponding notification as read
-    if notification = Notification.where(:recipient_id => current_user.id, :target_id => @status_message.id).first
-      notification.unread = false
-      notification.save
-    end
-
-    respond_with @status_message
-  else
-    Rails.logger.info(:event => :link_to_nonexistent_post, :ref => request.env['HTTP_REFERER'], :user_id => current_user.id, :post_id => params[:id])
-    flash[:error] = I18n.t('status_messages.show.not_found')
-    redirect_to :back
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/StatusMessagesHelper.html b/doc/StatusMessagesHelper.html deleted file mode 100644 index 955be614974..00000000000 --- a/doc/StatusMessagesHelper.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - Module: StatusMessagesHelper - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: StatusMessagesHelper - - - -

- -
- - - - - - - - -
Defined in:
-
app/helpers/status_messages_helper.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) my_latest_message - - - -

- - - - -
-
-
-
-6
-7
-8
-9
-10
-11
-12
-
-
# File 'app/helpers/status_messages_helper.rb', line 6
-
-def my_latest_message
-  unless @latest_status_message.nil?
-    return @latest_status_message.text
-  else
-    return I18n.t('status_messages.helper.no_message_to_display')
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/TagsController.html b/doc/TagsController.html deleted file mode 100644 index 9aff8454962..00000000000 --- a/doc/TagsController.html +++ /dev/null @@ -1,369 +0,0 @@ - - - - - - Class: TagsController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: TagsController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/tags_controller.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) index - - - -

- - - - -
-
-
-
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-
-
# File 'app/controllers/tags_controller.rb', line 14
-
-def index
-  if params[:q] && params[:q].length > 1
-    params[:q].gsub!("#", "")
-    params[:limit] = !params[:limit].blank? ? params[:limit].to_i : 10
-    @tags = ActsAsTaggableOn::Tag.named_like(params[:q]).limit(params[:limit] - 1)
-    @array = []
-    @tags.each do |obj|
-      @array << { :name => ("#"+obj.name),
-        :value => ("#"+obj.name)}
-    end
-
-    @array << { :name => ('#' + params[:q]), :value => ("#" + params[:q])}
-    @array.uniq!
-
-    respond_to do |format|
-      format.json{
-        render(:json => @array.to_json, :status => 200)
-      }
-    end
-  else
-    respond_to do |format|
-      format.json{ render :nothing => true, :status => 422 }
-      format.html{ redirect_to tag_path('partytimeexcellent') }
-    end
-  end
-end
-
-
-
- -
-

- - - (Object) show - - - -

- - - - -
-
-
-
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-69
-70
-71
-
-
# File 'app/controllers/tags_controller.rb', line 41
-
-def show
-  @aspect = :tag
-  if current_user
-    @posts = StatusMessage.joins(:contacts).where(:pending => false).where(
-      Contact.arel_table[:user_id].eq(current_user.id).or(
-        StatusMessage.arel_table[:public].eq(true).or(
-          StatusMessage.arel_table[:author_id].eq(current_user.person.id)
-        )
-      )).select('DISTINCT posts.*')
-  else
-    @posts = StatusMessage.where(:public => true, :pending => false)
-  end
-
-  @posts = @posts.tagged_with(params[:name])
-
-  max_time = params[:max_time] ? Time.at(params[:max_time].to_i) : Time.now
-  @posts = @posts.where(StatusMessage.arel_table[:created_at].lt(max_time))
-
-  @posts = @posts.includes(:comments, :photos).order('posts.created_at DESC').limit(15)
-
-  @posts = PostsFake.new(@posts)
-  @commenting_disabled = true
-
-  if params[:only_posts]
-    render :partial => 'shared/stream', :locals => {:posts => @posts}
-  else
-    profiles = Profile.tagged_with(params[:name]).where(:searchable => true).select('profiles.id, profiles.person_id')
-    @people = Person.where(:id => profiles.map{|p| p.person_id}).paginate(:page => params[:page], :per_page => 15)
-    @people_count = Person.where(:id => profiles.map{|p| p.person_id}).count
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/TokensController.html b/doc/TokensController.html deleted file mode 100644 index 7a788edbc4e..00000000000 --- a/doc/TokensController.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - Class: TokensController - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: TokensController - - - -

- -
- -
Inherits:
-
- ApplicationController - - - show all - -
- - - - - - - - - -
Defined in:
-
app/controllers/tokens_controller.rb
- -
-
- - - - - - - - - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods inherited from ApplicationController

-

#after_sign_in_path_for, #clear_gc_stats, #ensure_http_referer_is_set, #ensure_page, #grammatical_gender, #redirect_unless_admin, #set_git_header, #set_grammatical_gender, #set_header_data, #set_invites, #set_locale, #which_action_and_user

- - - -
-

Instance Method Details

- - -
-

- - - (Object) create - - - -

- - - - -
-
-
-
-2
-3
-4
-5
-6
-
-
# File 'app/controllers/tokens_controller.rb', line 2
-
-def create
-  current_user.reset_authentication_token!
-  current_user.authentication_token
-  redirect_to token_path, :notice => "Authentication token reset."
-end
-
-
-
- -
-

- - - (Object) show - - - -

- - - - -
-
-
-
-7
-8
-
-
# File 'app/controllers/tokens_controller.rb', line 7
-
-def show
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/User.html b/doc/User.html deleted file mode 100644 index 00059267719..00000000000 --- a/doc/User.html +++ /dev/null @@ -1,2412 +0,0 @@ - - - - - - Class: User - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: User - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - -
Includes:
-
Diaspora::UserModules, Encryptor::Private
- - - - - -
Defined in:
-
app/models/user.rb
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - - - - - - - - -

Methods included from Encryptor::Private

-

#aes_decrypt, #decrypt, #get_aes_key

- - - - - - - - - - - - - -

Methods included from Diaspora::UserModules::Querying

-

#all_aspect_ids, #aspects_with_person, #aspects_with_post, #contact_for, #contact_for_person_id, #contacts_in_aspects, #find_visible_post_by_id, #people_in_aspects, #posts_from, #visible_photos, #visible_posts

- - - - - - - - -

Methods included from Diaspora::UserModules::Connecting

-

#disconnect, #disconnected_by, #remove_contact, #share_with

- - - -
-

Class Method Details

- - -
-

- - + (Object) build(opts = {}) - - - -

-
-

-Helpers############ -

- - -
-
-
- -
- - - - -
-
-
-
-272
-273
-274
-275
-276
-
-
# File 'app/models/user.rb', line 272
-
-def self.build(opts = {})
-  u = User.new(opts)
-  u.setup(opts)
-  u
-end
-
-
-
- -
-

- - + (Object) find_for_database_authentication(conditions = {}) - - - -

- - - - -
-
-
-
-80
-81
-82
-83
-84
-85
-86
-87
-
-
# File 'app/models/user.rb', line 80
-
-def self.find_for_database_authentication(conditions={})
-  conditions = conditions.dup
-  conditions[:username] = conditions[:username].downcase
-  if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex
-    conditions[:email] = conditions.delete(:username)
-  end
-  where(conditions).first
-end
-
-
-
- -
-

- - + (Object) generate_key - - - -

- - - - -
-
-
-
-308
-309
-310
-311
-
-
# File 'app/models/user.rb', line 308
-
-def self.generate_key
-  key_size = (Rails.env == 'test' ? 512 : 4096)
-  OpenSSL::PKey::RSA::generate key_size
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Object) accept_invitation!(opts = {}) - - - -

- - - - -
-
-
-
-247
-248
-249
-250
-251
-252
-253
-254
-255
-256
-257
-258
-259
-260
-261
-262
-263
-264
-265
-266
-267
-268
-269
-
-
# File 'app/models/user.rb', line 247
-
-def accept_invitation!(opts = {})
-  log_string = "event=invitation_accepted username=#{opts[:username]} uid=#{self.id} "
-  log_string << "inviter=#{invitations_to_me.first.sender.diaspora_handle} " if invitations_to_me.first
-  begin
-    if self.invited?
-      self.setup(opts)
-      self.invitation_token = nil
-      self.password              = opts[:password]
-      self.password_confirmation = opts[:password_confirmation]
-      self.save!
-      invitations_to_me.each{|invitation| invitation.}
-      log_string << "success"
-      Rails.logger.info log_string
-
-      self.reload # Because to_request adds a request and saves elsewhere
-      self
-    end
-  rescue Exception => e
-    log_string << "failure"
-    Rails.logger.info log_string
-    raise e
-  end
-end
-
-
-
- -
-

- - - (Object) add_contact_to_aspect(contact, aspect) - - - -

- - - - -
-
-
-
-106
-107
-108
-109
-
-
# File 'app/models/user.rb', line 106
-
-def add_contact_to_aspect(contact, aspect)
-  return true if AspectMembership.exists?(:contact_id => contact.id, :aspect_id => aspect.id)
-  contact.aspect_memberships.create!(:aspect => aspect)
-end
-
-
-
- -
-

- - - (Object) add_to_streams(post, aspects_to_insert) - - - -

- - - - -
-
-
-
-138
-139
-140
-141
-142
-143
-
-
# File 'app/models/user.rb', line 138
-
-def add_to_streams(post, aspects_to_insert)
-  post.socket_to_user(self, :aspect_ids => aspects_to_insert.map{|x| x.id}) if post.respond_to? :socket_to_user
-  aspects_to_insert.each do |aspect|
-    aspect.posts << post
-  end
-end
-
-
-
- -
-

- - - (Boolean) admin? - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-317
-318
-319
-
-
# File 'app/models/user.rb', line 317
-
-def admin?
-  AppConfig[:admins].present? && AppConfig[:admins].include?(self.username)
-end
-
-
-
- -
-

- - - (Object) aspects_from_ids(aspect_ids) - - - -

- - - - -
-
-
-
-145
-146
-147
-148
-149
-150
-151
-
-
# File 'app/models/user.rb', line 145
-
-def aspects_from_ids(aspect_ids)
-  if aspect_ids == "all" || aspect_ids == :all
-    self.aspects
-  else
-    aspects.where(:id => aspect_ids)
-  end
-end
-
-
-
- -
-

- - - (Object) build_comment(options = {}) - - - -

-
-

-Commenting ######## -

- - -
-
-
- -
- - - - -
-
-
-
-165
-166
-167
-
-
# File 'app/models/user.rb', line 165
-
-def build_comment(options = {})
-  build_relayable(Comment, options)
-end
-
-
-
- -
-

- - - (Object) build_like(options = {}) - - - -

-
-

-Liking ######## -

- - -
-
-
- -
- - - - -
-
-
-
-170
-171
-172
-
-
# File 'app/models/user.rb', line 170
-
-def build_like(options = {})
-  build_relayable(, options)
-end
-
-
-
- -
-

- - - (Object) build_post(class_name, opts = {}) - - - -

-
-

-Posting ######## -

- - -
-
-
- -
- - - - -
-
-
-
-112
-113
-114
-115
-116
-117
-118
-
-
# File 'app/models/user.rb', line 112
-
-def build_post(class_name, opts = {})
-  opts[:author] = self.person
-  opts[:diaspora_handle] = opts[:author].diaspora_handle
-
-  model_class = class_name.to_s.camelize.constantize
-  model_class.diaspora_initialize(opts)
-end
-
-
-
- -
-

- - - (Object) build_relayable(model, options = {}) - - - -

- - - - -
-
-
-
-157
-158
-159
-160
-161
-162
-
-
# File 'app/models/user.rb', line 157
-
-def build_relayable(model, options = {})
-  r = model.new(options.merge(:author_id => self.person.id))
-  r.set_guid
-  r.initialize_signatures
-  r
-end
-
-
-
- -
-

- - - (Boolean) can_add?(person) - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-89
-90
-91
-92
-93
-
-
# File 'app/models/user.rb', line 89
-
-def can_add?(person)
-  return false if self.person == person
-  return false if self.contact_for(person).present?
-  true
-end
-
-
-
- -
-

- - - (Object) disconnect_everyone - - - -

- - - - -
-
-
-
-331
-332
-333
-334
-335
-336
-337
-338
-339
-340
-341
-
-
# File 'app/models/user.rb', line 331
-
-def disconnect_everyone
-  self.contacts.each do |contact|
-    if contact.person.remote?
-      self.disconnect(contact)
-    else
-      contact.person.owner.disconnected_by(self.person)
-      remove_contact(contact, :force => true)
-    end
-  end
-  self.aspects.destroy_all
-end
-
-
-
- -
-

- - - (Object) dispatch_post(post, opts = {}) - - - -

- - - - -
-
-
-
-120
-121
-122
-123
-
-
# File 'app/models/user.rb', line 120
-
-def dispatch_post(post, opts = {})
-  mailman = Postzord::Dispatch.new(self, post)
-  mailman.post(opts)
-end
-
-
-
- -
-

- - - (Object) encryption_key - - - -

- - - - -
-
-
-
-313
-314
-315
-
-
# File 'app/models/user.rb', line 313
-
-def encryption_key
-  OpenSSL::PKey::RSA.new(serialized_private_key)
-end
-
-
-
- -
-

- - - (Object) invite_user(aspect_id, service, identifier, invite_message = "") - - - -

-
-

-Invitations############ -

- - -
-
-
- -
- - - - -
-
-
-
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-
-
# File 'app/models/user.rb', line 234
-
-def invite_user(aspect_id, service, identifier, invite_message = "")
-  aspect = aspects.find(aspect_id)
-  if aspect
-    Invitation.invite(:service => service,
-                      :identifier => identifier,
-                      :from => self,
-                      :into => aspect,
-                      :message => invite_message)
-  else
-    false
-  end
-end
-
-
-
- -
-

- - - (Object) like_for(post) - - - -

- - - - -
-
-
-
-182
-183
-184
-185
-186
-187
-188
-189
-
-
# File 'app/models/user.rb', line 182
-
-def (post)
-  [post., post.dislikes].each do ||
-    .each do ||
-      return  if .author_id == self.person.id
-    end
-  end
-  return nil
-end
-
-
-
- -
-

- - - (Boolean) liked?(post) - - - -

-
- - -
-
-
-

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-174
-175
-176
-177
-178
-179
-180
-
-
# File 'app/models/user.rb', line 174
-
-def liked?(post)
-  if self.(post)
-    return true
-  else
-    return false
-  end
-end
-
-
-
- -
-

- - - (Object) mail(job, *args) - - - -

-
-

-Mailer ####################### -

- - -
-
-
- -
- - - - -
-
-
-
-192
-193
-194
-195
-196
-197
-
-
# File 'app/models/user.rb', line 192
-
-def mail(job, *args)
-  pref = job.to_s.gsub('Job::Mail', '').underscore
-  if(self.disable_mail == false && !self.user_preferences.exists?(:email_type => pref))
-    Resque.enqueue(job, *args)
-  end
-end
-
-
-
- -
-

- - - (Object) move_contact(person, to_aspect, from_aspect) - - - -

-
-

-Aspects ###################### -

- - -
-
-
- -
- - - - -
-
-
-
-96
-97
-98
-99
-100
-101
-102
-103
-104
-
-
# File 'app/models/user.rb', line 96
-
-def move_contact(person, to_aspect, from_aspect)
-  return true if to_aspect == from_aspect
-  contact = contact_for(person)
-
-  add_contact_to_aspect(contact, to_aspect)
-
-  membership = contact ? AspectMembership.where(:contact_id => contact.id, :aspect_id => from_aspect.id).first : nil
-  return(membership && membership.destroy)
-end
-
-
-
- -
-

- - - (Object) notify_if_mentioned(post) - - - -

- - - - -
-
-
-
-132
-133
-134
-135
-136
-
-
# File 'app/models/user.rb', line 132
-
-def notify_if_mentioned(post)
-  return unless self.contact_for(post.author) && post.respond_to?(:mentions?)
-
-  post.notify_person(self.person) if post.mentions? self.person
-end
-
-
-
- -
-

- - - (Object) remove_all_traces - - - -

- - - - -
-
-
-
-321
-322
-323
-324
-325
-
-
# File 'app/models/user.rb', line 321
-
-def remove_all_traces
-  disconnect_everyone
-  remove_mentions
-  remove_person
-end
-
-
-
- -
-

- - - (Object) remove_mentions - - - -

- - - - -
-
-
-
-343
-344
-345
-346
-347
-
-
# File 'app/models/user.rb', line 343
-
-def remove_mentions
-  Mention.where( :person_id => self.person.id).each do |mentioned_person|
-    mentioned_person.delete
-  end
-end
-
-
-
- -
-

- - - (Object) remove_person - - - -

- - - - -
-
-
-
-327
-328
-329
-
-
# File 'app/models/user.rb', line 327
-
-def remove_person
-  self.person.destroy
-end
-
-
-
- -
-

- - - (Object) retract(post) - - - -

-
-

-Posts and Such ############### -

- - -
-
-
- -
- - - - -
-
-
-
-200
-201
-202
-203
-204
-205
-206
-207
-208
-209
-210
-211
-212
-213
-214
-215
-
-
# File 'app/models/user.rb', line 200
-
-def retract(post)
-  if post.respond_to?(:relayable?) && post.relayable?
-    aspects = post.parent.aspects
-    retraction = RelayableRetraction.build(self, post)
-  else
-    aspects = post.aspects
-    retraction = Retraction.for(post)
-  end
-
-  mailman = Postzord::Dispatch.new(self, retraction)
-  mailman.post
-
-  retraction.perform(self)
-
-  retraction
-end
-
-
-
- -
-

- - - (Object) salmon(post) - - - -

- - - - -
-
-
-
-153
-154
-155
-
-
# File 'app/models/user.rb', line 153
-
-def salmon(post)
-  Salmon::SalmonSlap.create(self, post.to_diaspora_xml)
-end
-
-
-
- -
-

- - - (Object) seed_aspects - - - -

- - - - -
-
-
-
-303
-304
-305
-306
-
-
# File 'app/models/user.rb', line 303
-
-def seed_aspects
-  self.aspects.create(:name => I18n.t('aspects.seed.family'))
-  self.aspects.create(:name => I18n.t('aspects.seed.work'))
-end
-
-
-
- -
-

- - - (Object) set_current_language - - - -

- - - - -
-
-
-
-76
-77
-78
-
-
# File 'app/models/user.rb', line 76
-
-def set_current_language
-  self.language = I18n.locale.to_s if self.language.blank?
-end
-
-
-
- -
-

- - - (Object) setup(opts) - - - -

- - - - -
-
-
-
-278
-279
-280
-281
-282
-283
-284
-285
-286
-287
-288
-289
-290
-291
-292
-293
-294
-295
-296
-297
-298
-299
-300
-301
-
-
# File 'app/models/user.rb', line 278
-
-def setup(opts)
-  self.username = opts[:username]
-  self. = opts[:email]
-  self.valid?
-  errors = self.errors
-  errors.delete :person
-  return if errors.size > 0
-
-  opts[:person] ||= {}
-  unless opts[:person][:profile].is_a?(Profile)
-    opts[:person][:profile] ||= Profile.new
-    opts[:person][:profile] = Profile.new(opts[:person][:profile])
-  end
-
-  self.person = Person.new(opts[:person])
-  self.person.diaspora_handle = "#{opts[:username]}@#{AppConfig[:pod_uri].host}"
-  self.person.url = AppConfig[:pod_url]
-
-
-  self.serialized_private_key = User.generate_key if self.serialized_private_key.blank?
-  self.person.serialized_public_key = OpenSSL::PKey::RSA.new(self.serialized_private_key).public_key
-
-  self
-end
-
-
-
- -
-

- - - (Object) strip_and_downcase_username - - - -

- - - - -
-
-
-
-69
-70
-71
-72
-73
-74
-
-
# File 'app/models/user.rb', line 69
-
-def strip_and_downcase_username
-  if username.present?
-    username.strip!
-    username.downcase!
-  end
-end
-
-
-
- -
-

- - - (Object) update_post(post, post_hash = {}) - - - -

- - - - -
-
-
-
-125
-126
-127
-128
-129
-130
-
-
# File 'app/models/user.rb', line 125
-
-def update_post(post, post_hash = {})
-  if self.owns? post
-    post.update_attributes(post_hash)
-    Postzord::Dispatch.new(self, post).post
-  end
-end
-
-
-
- -
-

- - - (Object) update_profile(params) - - - -

-
-

-Profile ###################### -

- - -
-
-
- -
- - - - -
-
-
-
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228
-229
-230
-231
-
-
# File 'app/models/user.rb', line 218
-
-def update_profile(params)
-  if photo = params.delete(:photo)
-    photo.update_attributes(:pending => false) if photo.pending
-    params[:image_url] = photo.url(:thumb_large)
-    params[:image_url_medium] = photo.url(:thumb_medium)
-    params[:image_url_small] = photo.url(:thumb_small)
-  end
-  if self.person.profile.update_attributes(params)
-    Postzord::Dispatch.new(self, profile).post
-    true
-  else
-    false
-  end
-end
-
-
-
- -
-

- - - (Object) update_user_preferences(pref_hash) - - - -

- - - - -
-
-
-
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-
-
# File 'app/models/user.rb', line 50
-
-def update_user_preferences(pref_hash)
-  if self.disable_mail
-    UserPreference::VALID_EMAIL_TYPES.each{|x| self.user_preferences.find_or_create_by_email_type(x)}
-    self.disable_mail = false
-    self.save
-  end
-
-  pref_hash.keys.each do |key|
-    if pref_hash[key] == 'true'
-      self.user_preferences.find_or_create_by_email_type(key)
-    else
-      block = self.user_preferences.where(:email_type => key).first
-      if block
-        block.destroy
-      end
-    end
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/UserPreference.html b/doc/UserPreference.html deleted file mode 100644 index 692198b7204..00000000000 --- a/doc/UserPreference.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - Class: UserPreference - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Class: UserPreference - - - -

- -
- -
Inherits:
-
- ActiveRecord::Base - -
    -
  • Object
  • - - - - - -
- show all - -
- - - - - - - - - -
Defined in:
-
app/models/user_preference.rb
- -
-
- - -

Constant Summary

- -
- -
VALID_EMAIL_TYPES = - -
-
["mentioned",
-"comment_on_post",
-"private_message",
-"started_sharing",
-"also_commented",
-"liked"]
-
- -
- - - - - - - - - -

- Instance Method Summary - (collapse) -

- - - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) must_be_valid_email_type - - - -

- - - - -
-
-
-
-14
-15
-16
-17
-18
-
-
# File 'app/models/user_preference.rb', line 14
-
-def must_be_valid_email_type
-  unless VALID_EMAIL_TYPES.include?(self.)
-    errors.add(:email_type, 'supplied mail type is not a valid or known email type')
-  end
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/UsersHelper.html b/doc/UsersHelper.html deleted file mode 100644 index bd8b99409c2..00000000000 --- a/doc/UsersHelper.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - Module: UsersHelper - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: UsersHelper - - - -

- -
- - - - - - - - -
Defined in:
-
app/helpers/users_helper.rb
- -
-
- -

Overview

-
-

-Copyright © 2010, Diaspora Inc. This file is -

-
-  licensed under the Affero General Public License version 3 or later.  See
-  the COPYRIGHT file.
-
- - -
-
-
- -
- - - - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Instance Method Details

- - -
-

- - - (Object) first_name_or_username(user) - - - -

- - - - -
-
-
-
-6
-7
-8
-9
-
-
# File 'app/helpers/users_helper.rb', line 6
-
-def first_name_or_username (user)
-  set_name = user.person.profile.first_name
-  (set_name.nil? || set_name.empty?) ? user.username : user.person.profile.first_name 
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/YoutubeTitles.html b/doc/YoutubeTitles.html deleted file mode 100644 index 3c927ca37b7..00000000000 --- a/doc/YoutubeTitles.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - Module: YoutubeTitles - - — Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Module: YoutubeTitles - - - -

- -
- - - - - - - -
Included in:
-
Comment, StatusMessage
- - - -
Defined in:
-
lib/youtube_titles.rb
- -
-
- - -

Constant Summary

- -
- -
YOUTUBE_ID_REGEX = - -
-
/(?:https?:\/\/)(?:youtu\.be\/|(?:[a-z]{2,3}\.)?youtube\.com\/watch(?:\?|#!|.+&|.+&amp;)v=)([\w-]{11})(?:\S*(#[^ ]+)|\S+)?/im unless defined? YOUTUBE_ID_REGEX
-
- -
- - - - - - - -

- Class Method Summary - (collapse) -

- - - -

- Instance Method Summary - (collapse) -

- - - - - - -
-

Class Method Details

- - -
-

- - + (Object) included(model) - - - -

- - - - -
-
-
-
-2
-3
-4
-5
-6
-7
-8
-
-
# File 'lib/youtube_titles.rb', line 2
-
-def self.included(model)
-  model.class_eval do
-    before_save do
-      get_youtube_title text
-    end
-  end if model.respond_to?(:before_save)
-end
-
-
-
- -
- -
-

Instance Method Details

- - -
-

- - - (Object) get_youtube_title(text) - - - -

- - - - -
-
-
-
-21
-22
-23
-24
-25
-26
-27
-28
-29
-
-
# File 'lib/youtube_titles.rb', line 21
-
-def get_youtube_title text
-  youtube_match = text.enum_for(:scan, YOUTUBE_ID_REGEX).map { Regexp.last_match }
-  return if youtube_match.empty?
-
-  self.youtube_titles ||= {}
-  youtube_match.each do |match_data|
-    self.youtube_titles[match_data[1]] = CGI::escape(youtube_title_for(match_data[1]))
-  end
-end
-
-
-
- -
-

- - - (Object) youtube_title_for(video_id) - - - -

- - - - -
-
-
-
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-
-
# File 'lib/youtube_titles.rb', line 10
-
-def youtube_title_for video_id
-  http = Net::HTTP.new('gdata.youtube.com', 80)
-  path = "/feeds/api/videos/#{video_id}?v=2"
-  resp, data = http.get(path, nil)
-  title = data.match(/<title>(.*)<\/title>/)
-  unless title.nil?
-    title = title.to_s[7..-9]
-  end
-  title || I18n.t('application.helper.video_title.unknown')
-end
-
-
-
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/_index.html b/doc/_index.html deleted file mode 100644 index 5fc8c42aa86..00000000000 --- a/doc/_index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - Documentation by YARD 0.7.1 - - - - - - - - - - - - - - - - - - - - - - -

Documentation by YARD 0.7.1

-
-

Alphabetic Index

- -

File Listing

- - -
-

Namespace Listing A-Z

- - - - - - - - -
- - -
    -
  • P
  • -
      - -
    • - Post - -
    • - -
    -
- -
- -
- -
- - - - - \ No newline at end of file diff --git a/doc/class_list.html b/doc/class_list.html deleted file mode 100644 index e1d2f7a4e11..00000000000 --- a/doc/class_list.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
-

Class List

- - - - -
- - diff --git a/doc/css/common.css b/doc/css/common.css deleted file mode 100644 index cf25c45233d..00000000000 --- a/doc/css/common.css +++ /dev/null @@ -1 +0,0 @@ -/* Override this file with custom rules */ \ No newline at end of file diff --git a/doc/css/full_list.css b/doc/css/full_list.css deleted file mode 100644 index f95e4e68e6b..00000000000 --- a/doc/css/full_list.css +++ /dev/null @@ -1,53 +0,0 @@ -body { - margin: 0; - font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; - font-size: 13px; - height: 101%; - overflow-x: hidden; -} - -h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; } -.clear { clear: both; } -#search { position: absolute; right: 5px; top: 9px; padding-left: 24px; } -#content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCAAAACwAAAAAEAAQAAAHaIAAgoMgIiYlg4kACxIaACEJCSiKggYMCRselwkpghGJBJEcFgsjJyoAGBmfggcNEx0flBiKDhQFlIoCCA+5lAORFb4AJIihCRbDxQAFChAXw9HSqb60iREZ1omqrIPdJCTe0SWI09GBACH5BAkIAAAALAAAAAAQABAAAAdrgACCgwc0NTeDiYozCQkvOTo9GTmDKy8aFy+NOBA7CTswgywJDTIuEjYFIY0JNYMtKTEFiRU8Pjwygy4ws4owPyCKwsMAJSTEgiQlgsbIAMrO0dKDGMTViREZ14kYGRGK38nHguHEJcvTyIEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDAggPg4iJAAMJCRUAJRIqiRGCBI0WQEEJJkWDERkYAAUKEBc4Po1GiKKJHkJDNEeKig4URLS0ICImJZAkuQAhjSi/wQyNKcGDCyMnk8u5rYrTgqDVghgZlYjcACTA1sslvtHRgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCQARAtOUoQRGRiFD0kJUYWZhUhKT1OLhR8wBaaFBzQ1NwAlkIszCQkvsbOHL7Y4q4IuEjaqq0ZQD5+GEEsJTDCMmIUhtgk1lo6QFUwJVDKLiYJNUd6/hoEAIfkECQgAAAAsAAAAABAAEAAAB2iAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4uen4ICCA+IkIsDCQkVACWmhwSpFqAABQoQF6ALTkWFnYMrVlhWvIKTlSAiJiVVPqlGhJkhqShHV1lCW4cMqSkAR1ofiwsjJyqGgQAh+QQJCAAAACwAAAAAEAAQAAAHZ4AAgoOEhYaCJSWHgxGDJCSMhREZGIYYGY2ElYebi56fhyWQniSKAKKfpaCLFlAPhl0gXYNGEwkhGYREUywag1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; } -#full_list { padding: 0; list-style: none; margin-left: 0; } -#full_list ul { padding: 0; } -#full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; } -#noresults { padding: 7px 12px; } -#content.insearch #noresults { margin-left: 7px; } -ul.collapsed ul, ul.collapsed li { display: none; } -li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; } -li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; } -li { color: #888; cursor: pointer; } -li.deprecated { text-decoration: line-through; font-style: italic; } -li.r1 { background: #f0f0f0; } -li.r2 { background: #fafafa; } -li:hover { background: #ddd; } -li small:before { content: "("; } -li small:after { content: ")"; } -li small.search_info { display: none; } -a:link, a:visited { text-decoration: none; color: #05a; } -li.clicked { background: #05a; color: #ccc; } -li.clicked a:link, li.clicked a:visited { color: #eee; } -li.clicked a.toggle { opacity: 0.5; background-position: bottom right; } -li.collapsed.clicked a.toggle { background-position: top right; } -#search input { border: 1px solid #bbb; -moz-border-radius: 3px; -webkit-border-radius: 3px; } -#nav { margin-left: 10px; font-size: 0.9em; display: none; color: #aaa; } -#nav a:link, #nav a:visited { color: #358; } -#nav a:hover { background: transparent; color: #5af; } - -.frames #content h1 { margin-top: 0; } -.frames li { white-space: nowrap; cursor: normal; } -.frames li small { display: block; font-size: 0.8em; } -.frames li small:before { content: ""; } -.frames li small:after { content: ""; } -.frames li small.search_info { display: none; } -.frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; } -.frames #content.insearch #search { background-position: center right; } -.frames #search input { width: 110px; } -.frames #nav { display: block; } - -#full_list.insearch li { display: none; } -#full_list.insearch li.found { display: list-item; padding-left: 10px; } -#full_list.insearch li a.toggle { display: none; } -#full_list.insearch li small.search_info { display: block; } diff --git a/doc/css/style.css b/doc/css/style.css deleted file mode 100644 index 2c70d8fd3ea..00000000000 --- a/doc/css/style.css +++ /dev/null @@ -1,320 +0,0 @@ -body { - padding: 0 20px; - font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif; - font-size: 13px; -} -body.frames { padding: 0 5px; } -h1 { font-size: 25px; margin: 1em 0 0.5em; padding-top: 4px; border-top: 1px dotted #d5d5d5; } -h1.noborder { border-top: 0px; margin-top: 0; padding-top: 4px; } -h1.title { margin-bottom: 10px; } -h1.alphaindex { margin-top: 0; font-size: 22px; } -h2 { - padding: 0; - padding-bottom: 3px; - border-bottom: 1px #aaa solid; - font-size: 1.4em; - margin: 1.8em 0 0.5em; -} -h2 small { font-weight: normal; font-size: 0.7em; display: block; float: right; } -.clear { clear: both; } -.inline { display: inline; } -.inline p:first-child { display: inline; } -.docstring h1, .docstring h2, .docstring h3, .docstring h4 { padding: 0; border: 0; border-bottom: 1px dotted #bbb; } -.docstring h1 { font-size: 1.2em; } -.docstring h2 { font-size: 1.1em; } -.docstring h3, .docstring h4 { font-size: 1em; border-bottom: 0; padding-top: 10px; } -.summary_desc .object_link, .docstring .object_link { font-family: monospace; } - -/* style for