Skip to content

Commit

Permalink
added give_features support
Browse files Browse the repository at this point in the history
  • Loading branch information
unloved committed Feb 9, 2012
1 parent 4c26fda commit f4511a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/livejournal/entry.rb
Expand Up @@ -54,6 +54,7 @@ class Entry
attr_accessor :allowmask
attr_accessor :screening # values {:default, :all, :anonymous, :nonfriends, :none}
attr_accessor :interface # values {:web, ...}
attr_accessor :give_features

# A hash of any leftover properties (including those in KNOWN_EXTRA_PROPS)
# that aren't explicitly supported by ljrb. (See the
Expand Down Expand Up @@ -83,6 +84,7 @@ def initialize
@security = :public
@allowmask = nil
@screening = :default
@give_features = nil
@props = {}
end

Expand Down Expand Up @@ -167,6 +169,8 @@ def load_prop(name, value, strict=false) #:nodoc:#
@pickeyword = value
when 'taglist'
@taglist = value.split(/,\s/).sort
when 'give_features'
@give_features = value == '1'
else
# LJ keeps adding props, so we store all leftovers in a hash.
# Unfortunately, we don't know which of these need to be passed
Expand Down Expand Up @@ -231,6 +235,8 @@ def add_to_request req
req['allowmask'] = self.allowmask
end

req['give_features'] = self.give_features ? 1 : 0

req['year'], req['mon'], req['day'] =
self.time.year, self.time.mon, self.time.day
req['hour'], req['min'] = self.time.hour, self.time.min
Expand Down

0 comments on commit f4511a2

Please sign in to comment.