From a7caf248a37226cd8f3fb2c5e218ff7f0ffd17d2 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Wed, 29 Jun 2016 11:01:26 +0200 Subject: [PATCH] removes basically all code. Fresh start. --- src/de/fabianonline/telegram_backup/Main.java | 30 ------------- .../telegram_backup/MyStorage.java | 42 ------------------- 2 files changed, 72 deletions(-) delete mode 100644 src/de/fabianonline/telegram_backup/MyStorage.java diff --git a/src/de/fabianonline/telegram_backup/Main.java b/src/de/fabianonline/telegram_backup/Main.java index ded5d90..6774082 100644 --- a/src/de/fabianonline/telegram_backup/Main.java +++ b/src/de/fabianonline/telegram_backup/Main.java @@ -1,37 +1,7 @@ package de.fabianonline.telegram_backup; -import de.fabianonline.telegram_backup.MyStorage; -import org.telegram.api.engine.AppInfo; -import org.telegram.api.engine.ApiCallback; -import org.telegram.api.engine.TelegramApi; -import org.telegram.api.TLConfig; -import org.telegram.api.TLAbsUpdates; -import org.telegram.api.requests.*; -import java.io.IOException; - public class Main { public static void main(String[] args) { System.out.println("Hello World"); - - MyStorage storage = new MyStorage(); - - AppInfo appinfo = new AppInfo(32860, "Desktop", "0.0.1", "0.0.1", "EN"); - - ApiCallback callback = new ApiCallback() { - public void onApiDies(TelegramApi api) { System.out.println("onApiDies"); } - public void onUpdatesInvalidated(TelegramApi api) { System.out.println("onUpdatesInvalidated"); } - public void onUpdate(TLAbsUpdates updates) { System.out.println("onUpdate"); } - public void onAuthCancelled(TelegramApi api) { System.out.println("onAuthCancelled"); } - - }; - - TelegramApi api = new TelegramApi(storage, appinfo, callback); - - try { - TLConfig config = api.doRpcCall(new TLRequestHelpGetConfig()); - } catch(IOException ex) { - System.out.println("IOException caught."); - } - } } diff --git a/src/de/fabianonline/telegram_backup/MyStorage.java b/src/de/fabianonline/telegram_backup/MyStorage.java deleted file mode 100644 index 2520663..0000000 --- a/src/de/fabianonline/telegram_backup/MyStorage.java +++ /dev/null @@ -1,42 +0,0 @@ -package de.fabianonline.telegram_backup; - -import org.telegram.api.engine.storage.AbsApiState; -import org.telegram.api.TLConfig; -import org.telegram.mtproto.state.AbsMTProtoState; -import org.telegram.mtproto.state.ConnectionInfo; -import org.telegram.mtproto.state.KnownSalt; -import java.util.HashMap; - -public class MyStorage implements AbsApiState { - private int primaryDc = 2; - private HashMap isAuthenticated = new HashMap(); - private HashMap authKeys = new HashMap(); - - public int getPrimaryDc() { return primaryDc; } - public void setPrimaryDc(int newDc) { this.primaryDc = newDc; } - public boolean isAuthenticated(int dc) { - boolean temp = this.isAuthenticated.get(dc); - if (temp) return true; - return false; - } - public void setAuthenticated(int dc, boolean val) { this.isAuthenticated.put(dc, val); } - - public void updateSettings(TLConfig config) { System.out.println("Call to updateSettings"); } - - public byte[] getAuthKey(int dc) { return this.authKeys.get(dc); } - - public void putAuthKey(int dc, byte[] key) { this.authKeys.put(dc, key); } - - public ConnectionInfo[] getAvailableConnections(int dc) { - switch(dc) { - case 2: return new ConnectionInfo[]{new ConnectionInfo(1, 1, "149.154.167.50", 443)}; - } - return new ConnectionInfo[0]; - } - - public AbsMTProtoState getMtProtoState(int dc) { System.out.println("Call to getMtProtoState"); return null; } - - public void resetAuth() { this.isAuthenticated.clear(); this.authKeys.clear(); } - - public void reset() { this.resetAuth(); this.primaryDc=2; } -}