def add_to_request req
req['event'] = self.event
req['lineendings'] = 'unix'
req['subject'] = self.subject
case self.security
when :public
req['security'] = 'public'
when :friends
req['security'] = 'usemask'
req['allowmask'] = 1
when :private
req['security'] = 'private'
when :custom
req['security'] = 'usemask'
req['allowmask'] = self.allowmask
end
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
{ 'current_mood' => self.mood,
'current_moodid' => self.moodid,
'current_music' => self.music,
'current_location' => self.location,
'picture_keyword' => self.pickeyword,
'taglist' => self.taglist.join(', '),
'opt_preformatted' => self.preformatted ? 1 : 0,
'opt_nocomments' => self.comments == :none ? 1 : 0,
'opt_noemail' => self.comments == :noemail ? 1 : 0,
'opt_backdated' => self.backdated ? 1 : 0,
'opt_screening' =>
case self.screening
when :all; 'A'
when :anonymous; 'R'
when :nonfriends; 'F'
when :none; 'N'
when :default; ''
end
}.each do |name, value|
req["prop_#{name}"] = value
end
end