don't 404 on XMLRPC unknown methods, and do get_unread_topic correctly
This commit is contained in:
@@ -56,7 +56,8 @@ helpers do
|
||||
content_type("text/xml", :charset => "utf-8")
|
||||
send(method, *arguments)
|
||||
else
|
||||
raise Sinatra::NotFound
|
||||
puts "UNKNOWN METHOD: #{method}"
|
||||
respond_xmlrpc( 'result' => false, 'result_text' => binary_xmlrpc( "Unknown method: #{method}" ) )
|
||||
end
|
||||
end
|
||||
|
||||
@@ -201,7 +202,7 @@ helpers do
|
||||
"min_search_length" => 3, # Boring default
|
||||
"alert" => "0", # TODO
|
||||
"direct_unsubscribe" => "0", # TODO
|
||||
# "push_type" => "", # TODO - HIGH PRIORITY
|
||||
# "push_type" => "ann,conv,pm,sub,like,thank,quote,newtopic,tag",
|
||||
# "ban_delete_type" => "none", # TODO
|
||||
|
||||
"inappreg" => "0", # TODO
|
||||
@@ -239,7 +240,9 @@ helpers do
|
||||
|
||||
# These are returned by some other forums but aren't documented
|
||||
"key" => settings.tapatalk_api_key, # tapatalk API key, at a guess?
|
||||
"push" => "0",
|
||||
"push" => "0",
|
||||
|
||||
|
||||
# "allow_moderate",
|
||||
# "charset" => "ISO-8859-1",
|
||||
"disable_bbcode" => "0",
|
||||
@@ -374,14 +377,13 @@ helpers do
|
||||
topic_list = unread_topics.fetch( "topic_list" )
|
||||
topics = topic_list.fetch( "topics" )
|
||||
|
||||
result['topics'] = topics.collect {|hsh|
|
||||
# No idea what discourse actually returns, other than 0
|
||||
result['topics'] = topics.select {|hsh| hsh["unread"] != 0 }.collect {|hsh|
|
||||
build_tapatalk_topic( hsh, :users => unread_topics["users"], :categories => unread_topics["categories"] )
|
||||
}
|
||||
result['total_topic_num'] = result['topics'].count # api level 4
|
||||
|
||||
respond_xmlrpc( result )
|
||||
|
||||
xmlrpc_get_latest_topic( start_num, last_num, search_id, filters )
|
||||
end
|
||||
|
||||
def xmlrpc_get_latest_topic( start_num = 0, last_num = 0, search_id = nil, filters = nil )
|
||||
|
Reference in New Issue
Block a user