result = [-5, nil]
else
case message
- when "putway" then
+ when "putway"
orn = renumberednodes.dup
result = putway(renumberednodes, *args)
result[4] = renumberednodes.reject { |k, _v| orn.key?(k) }
result = putrelation(renumberednodes, renumberedways, *args)
when "deleteway"
result = deleteway(*args)
- when "putpoi" then
+ when "putpoi"
result = putpoi(*args)
renumberednodes[result[2]] = result[3] if result[0].zero? && result[2] != result[3]
when "startchangeset"
[-2, "An unusual error happened (in #{call}). The server said: #{e}"]
end
- def amf_handle_error_with_timeout(call, rootobj, rootid)
+ def amf_handle_error_with_timeout(call, rootobj, rootid, &block)
amf_handle_error(call, rootobj, rootid) do
- OSM::Timer.timeout(Settings.api_timeout, OSM::APITimeoutError) do
- yield
- end
+ OSM::Timer.timeout(Settings.api_timeout, OSM::APITimeoutError, &block)
end
end
# not just the id, hence this abstraction
def getuser(token)
- if token =~ /^(.+)\:(.+)$/
+ if token =~ /^(.+):(.+)$/
User.authenticate(:username => Regexp.last_match(1), :password => Regexp.last_match(2))
else
User.authenticate(:token => token)