Fixed wrong exclude_reply_user_ids for updating status

This commit is contained in:
Mariotaku Lee 2017-04-11 17:51:28 +08:00
parent 41caa9f9ee
commit 94560df05f
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
4 changed files with 64 additions and 5 deletions

View File

@ -55,9 +55,9 @@ public class StatusUpdate extends SimpleValueMap {
public StatusUpdate excludeReplyUserIds(@Nullable final String[] ids) {
if (ids == null) {
remove("exclude_reply_userids");
remove("exclude_reply_user_ids");
} else {
put("exclude_reply_userids", RestFuUtils.toString(ids, ','));
put("exclude_reply_user_ids", RestFuUtils.toString(ids, ','));
}
return this;
}

View File

@ -36,8 +36,8 @@ android {
applicationId "org.mariotaku.twidere"
minSdkVersion project.properties['overrideMinSdkVersion'] ?: 14
targetSdkVersion 25
versionCode 326
versionName '3.5.9'
versionCode 327
versionName '3.5.10'
multiDexEnabled true
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("true")'

View File

@ -25,6 +25,7 @@ import org.mariotaku.twidere.model.UserKey;
import org.mariotaku.twidere.model.account.cred.Credentials;
import org.mariotaku.twidere.model.util.AccountUtils;
import org.mariotaku.twidere.util.api.TwitterAndroidExtraHeaders;
import org.mariotaku.twidere.util.api.TwitterMacExtraHeaders;
import org.mariotaku.twidere.util.api.UserAgentExtraHeaders;
import java.util.List;
@ -176,7 +177,7 @@ public class MicroBlogAPIFactory implements TwidereConstants {
return new UserAgentExtraHeaders("Twitter/6.75.2 CFNetwork/811.4.18 Darwin/16.5.0");
}
case TWITTER_FOR_MAC: {
return new UserAgentExtraHeaders("Twitter-Mac/5002734 Mac/10.12.3 (;x86_64)");
return TwitterMacExtraHeaders.INSTANCE;
}
case TWEETDECK: {
return new UserAgentExtraHeaders(UserAgentUtils.getDefaultUserAgentStringSafe(context));

View File

@ -0,0 +1,58 @@
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.mariotaku.twidere.util.api
import android.os.Build
import org.mariotaku.ktextension.bcp47Tag
import org.mariotaku.twidere.util.MicroBlogAPIFactory.ExtraHeaders
import java.util.*
/**
* Created by mariotaku on 2017/2/25.
*/
object TwitterMacExtraHeaders : ExtraHeaders {
const val clientName = "Twitter-Mac"
const val versionName = "6.41.0"
const val platformName = "Mac"
const val platformVersion = "10.12.3"
const val platformArchitecture = "x86_64"
const val internalVersionName = "5002734"
override fun get(): List<Pair<String, String>> {
val result = ArrayList<Pair<String, String>>()
val language = Locale.getDefault().bcp47Tag
result.add(Pair("User-Agent", userAgent))
result.add(Pair("Accept-Language", language))
result.add(Pair("X-Twitter-Client", clientName))
result.add(Pair("X-Twitter-Client-Version", versionName))
return result
}
val userAgent: String get() {
val model = Build.MODEL
val manufacturer = Build.MANUFACTURER
val sdkRelease = Build.VERSION.RELEASE
val brand = Build.BRAND
val product = Build.PRODUCT
return "$clientName/($internalVersionName) $platformName/$platformVersion (;$platformArchitecture)"
}
}