diaspora_federation 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42c68f5013a4c3f538bdf2d0c304d79b42e09ab5
4
- data.tar.gz: a3a21dd08bac81bc602fbee8e9ce7f4f726d7413
3
+ metadata.gz: af0fdb0f1947dce9a20099a76921b58ad265032c
4
+ data.tar.gz: 45a617bd5cf74ccbba10a73372c5b8aad8ec5e55
5
5
  SHA512:
6
- metadata.gz: d4858c3925cd46cd2adf8097066340445129c7630f6a41c8560edac13cc233c825d7b8ae593f3bc917848003f722f4035dca0bf6716c87edb56f99035ffd4b20
7
- data.tar.gz: 8bca5a011c3bb00cc128ef5cea489fe1e575bcdb6a3a74cede7fa5336f7c86f6b102ed0e3980b2a370eeba42e14d6c0b7d99b29a40ee7673477645420d9c1bc8
6
+ metadata.gz: 044a46b0f3d099863f7d7a6496bcdefa54a63c58689563a4fc74d96d42bcc49cb340089821836342a1c1801c7797ad4b8a926976299235dc5722499e95f92969
7
+ data.tar.gz: 392b7a4b746d01ab534a9ea164c956a3b2cbea6817489baf3829d253caae3dee979f260755b9b1a7ebbb546bfb76d4fd62cea80c460fe0be06639e9035ba710f
@@ -1,19 +1,29 @@
1
+ # 0.2.4
2
+
3
+ ## Features
4
+
5
+ * Make some entities editable and add `edited_at` property [#94](https://github.com/diaspora/diaspora_federation/pull/94)
6
+
7
+ ## Bug fixes
8
+
9
+ * Fix validation of optional properties (for example for WebFinger) [#97](https://github.com/diaspora/diaspora_federation/pull/97)
10
+
1
11
  # 0.2.3
2
12
 
3
13
  ## Features
4
14
 
5
- Add `blocking` flag to `Contact` entity [#80](https://github.com/diaspora/diaspora_federation/pull/80)
6
- Introduce alternative form for `AccountMigration` entity signature [#89](https://github.com/diaspora/diaspora_federation/pull/89)
15
+ * Add `blocking` flag to `Contact` entity [#80](https://github.com/diaspora/diaspora_federation/pull/80)
16
+ * Introduce alternative form for `AccountMigration` entity signature [#89](https://github.com/diaspora/diaspora_federation/pull/89)
7
17
 
8
18
  ## Refactor
9
19
 
10
- Extract signing of `AccountMigration` to a different module [#89](https://github.com/diaspora/diaspora_federation/pull/89)
11
- Remove participants limit for conversations [#91](https://github.com/diaspora/diaspora_federation/pull/91)
20
+ * Extract signing of `AccountMigration` to a different module [#89](https://github.com/diaspora/diaspora_federation/pull/89)
21
+ * Remove participants limit for conversations [#91](https://github.com/diaspora/diaspora_federation/pull/91)
12
22
 
13
23
  ## Bug fixes
14
24
 
15
- Fix when booleans in relayables are false [#90](https://github.com/diaspora/diaspora_federation/pull/90)
16
- Fix relayable signatures for messages with invalid XML characters [#95](https://github.com/diaspora/diaspora_federation/pull/95)
25
+ * Fix when booleans in relayables are false [#90](https://github.com/diaspora/diaspora_federation/pull/90)
26
+ * Fix relayable signatures for messages with invalid XML characters [#95](https://github.com/diaspora/diaspora_federation/pull/95)
17
27
 
18
28
  # 0.2.2
19
29
 
@@ -48,7 +48,7 @@ module DiasporaFederation
48
48
  # @!attribute [r] nickname
49
49
  # The first part of the diaspora* ID
50
50
  # @return [String] nickname
51
- property :nickname, :string, default: nil
51
+ property :nickname, :string, optional: true
52
52
 
53
53
  # @!attribute [r] full_name
54
54
  # @return [String] display name of the user
@@ -60,7 +60,7 @@ module DiasporaFederation
60
60
  # installations).
61
61
  #
62
62
  # @return [String] link to the pod
63
- property :url, :string, default: nil
63
+ property :url, :string, optional: true
64
64
 
65
65
  # @!attribute [r] public_key
66
66
  # When a user is created on the pod, the pod MUST generate a pgp keypair
@@ -44,7 +44,7 @@ module DiasporaFederation
44
44
 
45
45
  # @!attribute [r] profile_url
46
46
  # @return [String] link to the users profile
47
- property :profile_url, :string, default: nil
47
+ property :profile_url, :string, optional: true
48
48
 
49
49
  # @!attribute [r] atom_url
50
50
  # This atom feed is an Activity Stream of the user's public posts. diaspora*
@@ -55,18 +55,18 @@ module DiasporaFederation
55
55
  # Note that this feed MAY also be made available through the PubSubHubbub
56
56
  # mechanism by supplying a <link rel="hub"> in the atom feed itself.
57
57
  # @return [String] atom feed url
58
- property :atom_url, :string, default: nil
58
+ property :atom_url, :string, optional: true
59
59
 
60
60
  # @!attribute [r] salmon_url
61
61
  # @note could be nil
62
62
  # @return [String] salmon endpoint url
63
63
  # @see https://cdn.rawgit.com/salmon-protocol/salmon-protocol/master/draft-panzer-salmon-00.html#SMLR
64
64
  # Panzer draft for Salmon, paragraph 3.3
65
- property :salmon_url, :string, default: nil
65
+ property :salmon_url, :string, optional: true
66
66
 
67
67
  # @!attribute [r] subscribe_url
68
68
  # This url is used to find another user on the home-pod of the user in the webfinger.
69
- property :subscribe_url, :string, default: nil
69
+ property :subscribe_url, :string, optional: true
70
70
 
71
71
  # +hcard_url+ link relation
72
72
  REL_HCARD = "http://microformats.org/profile/hcard".freeze
@@ -43,7 +43,7 @@ module DiasporaFederation
43
43
  # Returns diaspora* ID of the new person identity.
44
44
  # @return [String] diaspora* ID of the new person identity
45
45
  def new_identity
46
- profile.author
46
+ profile.author if profile
47
47
  end
48
48
 
49
49
  # @return [String] string representation of this object
@@ -17,6 +17,11 @@ module DiasporaFederation
17
17
  # Comment entity creation time
18
18
  # @return [Time] creation time
19
19
  property :created_at, :timestamp, default: -> { Time.now.utc }
20
+
21
+ # @!attribute [r] edited_at
22
+ # The timestamp when the comment was edited
23
+ # @return [Time] edited time
24
+ property :edited_at, :timestamp, optional: true
20
25
  end
21
26
  end
22
27
  end
@@ -16,6 +16,11 @@ module DiasporaFederation
16
16
  # @return [String] guid
17
17
  property :guid, :string
18
18
 
19
+ # @!attribute [r] edited_at
20
+ # The timestamp when the event was edited
21
+ # @return [Time] edited time
22
+ property :edited_at, :timestamp, optional: true
23
+
19
24
  # @!attribute [r] summary
20
25
  # The summary of the event
21
26
  # @return [String] event summary
@@ -14,6 +14,11 @@ module DiasporaFederation
14
14
  # "accepted", "declined" or "tentative"
15
15
  # @return [String] event participation status
16
16
  property :status, :string
17
+
18
+ # @!attribute [r] edited_at
19
+ # The timestamp when the event participation was edited
20
+ # @return [Time] edited time
21
+ property :edited_at, :timestamp, optional: true
17
22
  end
18
23
  end
19
24
  end
@@ -26,6 +26,11 @@ module DiasporaFederation
26
26
  # @return [Time] creation time
27
27
  property :created_at, :timestamp, default: -> { Time.now.utc }
28
28
 
29
+ # @!attribute [r] edited_at
30
+ # The timestamp when the message was edited
31
+ # @return [Time] edited time
32
+ property :edited_at, :timestamp, optional: true
33
+
29
34
  # @!attribute [r] conversation_guid
30
35
  # Guid of a conversation this message belongs to
31
36
  # @see Conversation#guid
@@ -26,6 +26,11 @@ module DiasporaFederation
26
26
  # @return [Time] creation time
27
27
  property :created_at, :timestamp, default: -> { Time.now.utc }
28
28
 
29
+ # @!attribute [r] edited_at
30
+ # The timestamp when the photo was edited
31
+ # @return [Time] edited time
32
+ property :edited_at, :timestamp, optional: true
33
+
29
34
  # @!attribute [r] remote_photo_path
30
35
  # An url of the photo on a remote server
31
36
  # @return [String] remote photo url
@@ -14,6 +14,11 @@ module DiasporaFederation
14
14
  # @return [String] diaspora* ID
15
15
  property :author, :string, alias: :diaspora_id, xml_name: :diaspora_handle
16
16
 
17
+ # @!attribute [r] edited_at
18
+ # The timestamp when the profile was edited
19
+ # @return [Time] edited time
20
+ property :edited_at, :timestamp, optional: true
21
+
17
22
  # @!attribute [r] first_name
18
23
  # @deprecated We decided to only use one name field, these should be removed
19
24
  # in later iterations (will affect older diaspora* installations).
@@ -11,6 +11,11 @@ module DiasporaFederation
11
11
  # @return [String] text of the status message
12
12
  property :text, :string, xml_name: :raw_message
13
13
 
14
+ # @!attribute [r] edited_at
15
+ # The timestamp when the status message was edited
16
+ # @return [Time] edited time
17
+ property :edited_at, :timestamp, optional: true
18
+
14
19
  # @!attribute [r] photos
15
20
  # Optional photos attached to the status message
16
21
  # @return [[Entities::Photo]] photos
@@ -9,7 +9,7 @@ module DiasporaFederation
9
9
 
10
10
  rule :subject, [:not_empty, length: {maximum: 255}]
11
11
 
12
- rule :participants, diaspora_id_list: {minimum: 2}
12
+ rule :participants, [:not_empty, diaspora_id_list: {minimum: 2}]
13
13
  rule :messages, :not_nil
14
14
  end
15
15
  end
@@ -6,7 +6,7 @@ module DiasporaFederation
6
6
 
7
7
  include RelayableValidator
8
8
 
9
- rule :status, regular_expression: {regex: /\A(accepted|declined|tentative)\z/}
9
+ rule :status, [:not_empty, regular_expression: {regex: /\A(accepted|declined|tentative)\z/}]
10
10
  end
11
11
  end
12
12
  end
@@ -13,10 +13,8 @@ module DiasporaFederation
13
13
  private
14
14
 
15
15
  def optional_props
16
- entity_name = self.class.name.split("::").last.sub("Validator", "")
17
- return [] unless Entities.const_defined?(entity_name)
18
-
19
- Entities.const_get(entity_name).optional_props
16
+ return [] unless @obj.class.respond_to?(:optional_props)
17
+ @obj.class.optional_props
20
18
  end
21
19
  end
22
20
  end
@@ -1,4 +1,4 @@
1
1
  module DiasporaFederation
2
2
  # the gem version
3
- VERSION = "0.2.3".freeze
3
+ VERSION = "0.2.4".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diaspora_federation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Neff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-27 00:00:00.000000000 Z
11
+ date: 2018-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday