Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #61 from plar/master

issue TFJ-678
  • Loading branch information...
commit 92d2ddb093c7275a910fe7cc527eb6a7dfb6f184 2 parents a5aafca + e33f01b
@yusuke authored
View
5 twitter4j-core/src/main/java/twitter4j/TwitterImpl.java
@@ -52,7 +52,7 @@
/*package*/
TwitterImpl(Configuration conf, Authorization auth) {
super(conf, auth);
- INCLUDE_MY_RETWEET = new HttpParameter("include_my_retweet", 1);
+ INCLUDE_MY_RETWEET = new HttpParameter("include_my_retweet", conf.isIncludeMyRetweetEnabled());
if (conf.getContributingTo() != -1L) {
IMPLICIT_PARAMS_STR = "include_entities=1&include_rts=1&contributingto=" + conf.getContributingTo();
IMPLICIT_PARAMS = new HttpParameter[]{new HttpParameter("include_entities", "1")
@@ -169,7 +169,8 @@ private String toDateStr(Date date) {
public ResponseList<Status> getHomeTimeline() throws
TwitterException {
ensureAuthorizationEnabled();
- return factory.createStatusList(get(conf.getRestBaseURL() + "statuses/home_timeline.json?include_my_retweet=1"));
+ return factory.createStatusList(get(conf.getRestBaseURL()
+ + "statuses/home_timeline.json", new HttpParameter[] { INCLUDE_MY_RETWEET }));
}
/**
View
2  twitter4j-core/src/main/java/twitter4j/conf/Configuration.java
@@ -103,6 +103,8 @@
String getSiteStreamBaseURL();
String getUploadBaseURL();
+
+ boolean isIncludeMyRetweetEnabled();
boolean isJSONStoreEnabled();
View
12 twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBase.java
@@ -74,6 +74,8 @@
private boolean includeRTsEnabled = true;
private boolean includeEntitiesEnabled = true;
+
+ private boolean includeMyRetweetEnabled = true;
private boolean jsonStoreEnabled;
@@ -644,8 +646,16 @@ protected final void setIncludeRTsEnbled(boolean enabled) {
protected final void setIncludeEntitiesEnbled(boolean enabled) {
this.includeEntitiesEnabled = enabled;
}
+
+ public boolean isIncludeMyRetweetEnabled() {
+ return this.includeMyRetweetEnabled;
+ }
- public boolean isJSONStoreEnabled() {
+ public void setIncludeMyRetweetEnabled(boolean enabled) {
+ this.includeMyRetweetEnabled = enabled;
+ }
+
+ public boolean isJSONStoreEnabled() {
return this.jsonStoreEnabled;
}
View
6 twitter4j-core/src/main/java/twitter4j/conf/ConfigurationBuilder.java
@@ -253,6 +253,12 @@ public ConfigurationBuilder setIncludeEntitiesEnabled(boolean enabled) {
return this;
}
+ public ConfigurationBuilder setIncludeMyRetweetEnabled(boolean enabled) {
+ checkNotBuilt();
+ configurationBean.setIncludeMyRetweetEnabled(enabled);
+ return this;
+ }
+
public ConfigurationBuilder setJSONStoreEnabled(boolean enabled) {
checkNotBuilt();
configurationBean.setJSONStoreEnabled(enabled);
Please sign in to comment.
Something went wrong with that request. Please try again.