Browse Source

Prevents Twitter client from checking for updates if the client is not authorized with the account.

Fixes CLIENT-147

Change-Id: I57fd93c63d11fa30b7ea2ff526e60dc111d54a7e
Reviewed-on: http://gerrit.dmdirc.com/1754
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.5
Simon Mott 13 years ago
parent
commit
3bfe4a324b
1 changed files with 15 additions and 13 deletions
  1. 15
    13
      src/com/dmdirc/addons/parser_twitter/Twitter.java

+ 15
- 13
src/com/dmdirc/addons/parser_twitter/Twitter.java View File

@@ -1119,21 +1119,23 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1119 1119
             final int startCalls = wantAuth ? 0 : api.getUsedCalls();
1120 1120
 
1121 1121
             // Get Updates
1122
-            final boolean foundUpdates = getUpdates(channel);
1123
-            if (first && !foundUpdates) {
1124
-                sendChannelMessage(channel, "No new items found.");
1125
-            }
1126
-            first = false;
1122
+            if (!wantAuth) {
1123
+                final boolean foundUpdates = getUpdates(channel);
1124
+                if (first && !foundUpdates) {
1125
+                    sendChannelMessage(channel, "No new items found.");
1126
+                }
1127
+                first = false;
1127 1128
 
1128
-            // Store last IDs
1129
-            IdentityManager.getConfigIdentity().setOption(myPlugin.getDomain(), "lastReplyId-" + myServerName + "-" + myUsername, Long.toString(lastReplyId));
1130
-            IdentityManager.getConfigIdentity().setOption(myPlugin.getDomain(), "lastTimelineId-" + myServerName + "-" + myUsername, Long.toString(lastTimelineId));
1131
-            IdentityManager.getConfigIdentity().setOption(myPlugin.getDomain(), "lastDirectMessageId-" + myServerName + "-" + myUsername, Long.toString(lastDirectMessageId));
1129
+                // Store last IDs
1130
+                IdentityManager.getConfigIdentity().setOption(myPlugin.getDomain(), "lastReplyId-" + myServerName + "-" + myUsername, Long.toString(lastReplyId));
1131
+                IdentityManager.getConfigIdentity().setOption(myPlugin.getDomain(), "lastTimelineId-" + myServerName + "-" + myUsername, Long.toString(lastTimelineId));
1132
+                IdentityManager.getConfigIdentity().setOption(myPlugin.getDomain(), "lastDirectMessageId-" + myServerName + "-" + myUsername, Long.toString(lastDirectMessageId));
1132 1133
 
1133
-            // Get Updates for search channels
1134
-            for (final TwitterChannelInfo searchChannel : channels.values()) {
1135
-                if (searchChannel.getName().startsWith("#")) {
1136
-                    getUpdates(searchChannel);
1134
+                // Get Updates for search channels
1135
+                for (final TwitterChannelInfo searchChannel : channels.values()) {
1136
+                    if (searchChannel.getName().startsWith("#")) {
1137
+                        getUpdates(searchChannel);
1138
+                    }
1137 1139
                 }
1138 1140
             }
1139 1141
 

Loading…
Cancel
Save