From 2623f90c9c1ff83e827a35fbc063adf18117a06d Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Wed, 25 Sep 2013 19:59:00 +0100 Subject: [PATCH] Fix some API problems with get_config We now advertise API level 3 correctly, allowing the official Tapatalk client to connect to our forum. It can't display anything, as we've not implemented get_latest_topic yet, but that's OK. --- lib/tapatalker.rb | 131 +++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/lib/tapatalker.rb b/lib/tapatalker.rb index 52854fe..e772d8d 100644 --- a/lib/tapatalker.rb +++ b/lib/tapatalker.rb @@ -109,72 +109,97 @@ helpers do # whole hash. def xmlrpc_get_config( name = nil ) result = { + + # Uncontroversial "sys_version" => "0.1", # For now "version" => "dev", # For now "api_level" => "3", # Maybe? "is_open" => true, # Set to false to stop working - "guest_ok" => true, # Maybe? - "report_post" => false, # TODO - "report_pm" => false, # TODO - "goto_post" => false, # TODO - "goto_unread" => false, # TODO + "guest_okay" => true, + + # These are optional, and assume 1 if missing "mark_read" => "0", # TODO - "mark_forum" => "0", # TODO - "no_refresh_on_post" => "0", # TODO "subscribe_forum" => "0", # TODO - "get_latest_topic" => "0", # TODO - "get_id_by_url" => "0", # TODO - "delete_reason" => "0", # TODO - "mod_approve" => "0", # TODO - "mod_delete" => "0", # TODO - "mod_report" => "0", # TODO - "guest_search" => "0", # TODO - "anonymous" => "0", # TODO - "guest_whosonline" => "0", # TODO - "searchid" => "0", # TODO - "avatar" => "0", # TODO - "pm_load" => "0", # TODO - "subscribe_load" => "0", # TODO + "announcement" => "0", # Probably? + + # These are optional, and assume 0 if missing + # "delete_reason" => "0", # TODO + # "m_approve" => "0", # TODO + # "m_delete" => "0", # TODO + # "m_report" => "0", # TODO + # "guest_search" => "0", # TODO + # "guest_whosonline" => "0", # TODO + # "emoji" => "0", # Probably? + # "support_md5" => "0", # TODO + # "support_sha1" => "0", # TODO + # "conversation" => "0", # TODO + # "advanced_delete" => "0", # TODO + # "get_activity" => "0", # TODO + # "prefix_edit" => "0", # TODO + # "anonymous_login" => "0", # TODO + # "search_user" => "0", # TODO + # "user_recommend" => "0", # TODO + + # Other optional params "min_search_length" => 3, # Boring default - "inbox_stat" => "0", # TODO - "multi_quote" => "0", # TODO - "default_smilies" => "1", # Probably? - "can_unread" => "0", # Probably - "announcement" => "0", # Probably? - "emoji" => "0", # Probably? - "support_md5" => "0", # TODO - "support_sha1" => "0", # TODO - "conversation" => "0", # TODO - "get_forum" => "1", # No sub-forums in discourse but it needs this anyway - "get_topic_status" => "0", # TODO - "get_participated_forum" => "0", # TODO - "get_forum_status" => "1", # TODO - "get_smilies" => "0", # TODO - "advanced_online_users" => "0", # TODO - "mark_pm_unread" => "0", # Probably? - "advanced_search" => "0", # TODO - "mass_subscribe" => "0", # TODO - "user_id" => "0", # TODO - "advanced_delete" => "0", # TODO - "mark_topic_read" => "0", # TODO - "first_unread" => "0", # TODO "alert" => "0", # TODO "direct_unsubscribe" => "0", # TODO - "get_activity" => "0", # TODO - "prefix_edit" => "0", # TODO - "push_type" => "", # TODO - HIGH PRIORITY - "ban_delete_type" => "0", # TODO - "anonymous_login" => "0", # TODO - "search_user" => "0", # TODO - "user_recommend" => "0", # TODO + # "push_type" => "", # TODO - HIGH PRIORITY + # "ban_delete_type" => "none", # TODO + "inappreg" => "0", # TODO "inappsignin" => "0", # TODO - HIGH PRIORITY - "ignore_user" => "0" # TODO - } - + "ignore_user" => "0", # TODO + + # These are API level 4 items. Ignore for now. + # "goto_post" => false, # TODO + # "goto_unread" => false, # TODO + # "mark_forum" => "0", # TODO + # "no_refresh_on_post" => "0", # TODO + # "get_latest_topic" => "0", # TODO + # "get_id_by_url" => "0", # TODO + # "anonymous" => "0", # TODO + # "searchid" => "0", # TODO + # "avatar" => "0", # TODO + # "pm_load" => "0", # TODO + # "subscribe_load" => "0", # TODO + # "inbox_stat" => "0", # TODO + # "multi_quote" => "0", # TODO + # "default_smilies" => "1", # Probably? + # "can_unread" => "0", # Probably + # "get_forum" => "1", # No sub-forums in discourse but it needs this anyway + # "get_topic_status" => "0", # TODO + # "get_participated_forum" => "0", # TODO + # "get_forum_status" => "1", # TODO + # "get_smilies" => "0", # TODO + # "advanced_online_users" => "0", # TODO + # "mark_pm_unread" => "0", # Probably? + # "advanced_search" => "0", # TODO + # "mass_subscribe" => "0", # TODO + # "user_id" => "0", # TODO + # "mark_topic_read" => "0", # TODO + # "first_unread" => "0", # TODO + + # These are returned by some other forums but aren't documented + "key" => settings.tapatalk_api_key, # tapatalk API key, at a guess? + "push" => "0", + # "allow_moderate", + # "charset" => "ISO-8859-1", + "disable_bbcode" => "0", + # "disable_subscribe_forum" => "0", + # "forum_signature" => 1, + # "get_online_users" => "1", + + # No idea what this does + # "hide_forum_id" => "", + + # "reg_url" => "register.php", + # "sign_in" => "1", + # "stats" => {"user"=>320812, "topic"=>233040, "post"=>2389071} + } respond_xmlrpc( result ) end - + # Ignore forum_id for now. Naughty naughty. def xmlrpc_get_forum( return_description = nil, forum_id = nil)