mirror of
				https://github.com/fabianonline/telegram_backup.git
				synced 2025-10-31 07:39:21 +00:00 
			
		
		
		
	Rewritten FLOOD_WAIT detection code.
This commit is contained in:
		| @@ -70,7 +70,7 @@ public class DownloadManager { | |||||||
| 			try { | 			try { | ||||||
| 				_downloadMessages(limit); | 				_downloadMessages(limit); | ||||||
| 			} catch (RpcErrorException e) { | 			} catch (RpcErrorException e) { | ||||||
| 				if (e.getTag().startsWith("420: FLOOD_WAIT_")) { | 				if (e.getCode()==420) { // FLOOD_WAIT | ||||||
| 					completed = false; | 					completed = false; | ||||||
| 					Utils.obeyFloodWaitException(e); | 					Utils.obeyFloodWaitException(e); | ||||||
| 				} else { | 				} else { | ||||||
|   | |||||||
| @@ -34,9 +34,9 @@ public class Utils { | |||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
| 	static void obeyFloodWaitException(RpcErrorException e) throws RpcErrorException { | 	static void obeyFloodWaitException(RpcErrorException e) throws RpcErrorException { | ||||||
| 		if (e==null || ! e.getTag().startsWith("420: FLOOD_WAIT_")) return; | 		if (e==null || e.getCode()!=420) return; | ||||||
| 		 | 		 | ||||||
| 		int delay = Integer.parseInt(e.getTag().substring(16)); | 		int delay = e.getTagInteger(); | ||||||
| 		int minutes = (delay/60)+1; | 		int minutes = (delay/60)+1; | ||||||
| 		int wait = (minutes / 5) * 5 + 5; | 		int wait = (minutes / 5) * 5 + 5; | ||||||
| 		System.out.println(""); | 		System.out.println(""); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user