lib/social_profile/people/vkontakte.rb in social_profile-0.1.2 vs lib/social_profile/people/vkontakte.rb in social_profile-0.1.3
- old
+ new
@@ -76,18 +76,21 @@
protected
def find_upload_url
server = @target.photos.getUploadServer(:aid => identifier)
- if server && server['response']
+ if server && server['upload_url']
+ server['upload_url']
+ elsif server && server['response']
server['response']['upload_url']
else
nil
end
end
def normalize_hash(hash)
- response = (hash && hash["response"] ? Array.wrap(hash["response"]).first : hash)
+ hash = hash["response"] if hash.is_a?(Hash) && hash["response"]
+ response = Array.wrap(hash).first
response || {}
end
end
end
\ No newline at end of file