utf8: Safeguard against use of old *and* new option
The new 'utf8foldernames' will not work together with the existing 'decodefoldernames' option (which will be documented in the next commit). Therefore this commit will check for this condition and abort the synchronization of a misconfigured account before doing any changes. Other accounts are not affected. Signed-off-by: Urs Liska <git@ursliska.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
		 Urs Liska
					Urs Liska
				
			
				
					committed by
					
						 Nicolas Sebrecht
						Nicolas Sebrecht
					
				
			
			
				
	
			
			
			 Nicolas Sebrecht
						Nicolas Sebrecht
					
				
			
						parent
						
							ef3299b7ce
						
					
				
				
					commit
					8b398f3aa8
				
			| @@ -274,6 +274,21 @@ class SyncableAccount(Account): | ||||
|                 raise | ||||
|             return | ||||
|  | ||||
|         if self.utf_8_support and self.remoterepos.getdecodefoldernames(): | ||||
|             e = OfflineImapError("Configuration mismatch in account " + | ||||
|                         "'%s'. "% self.getname() + | ||||
|                         "\nAccount setting 'utf8foldernames' and repository " + | ||||
|                         "setting 'decodefoldernames'\nmay not be used at the " + | ||||
|                         "same time. This account has not been synchronized.\n" + | ||||
|                         "Please check the configuration and documentation.", | ||||
|                     OfflineImapError.ERROR.REPO) | ||||
|             self.ui.error(e, exc_info()[2], | ||||
|                           msg="Configuration mismatch in account " + | ||||
|                         "'%s'. "% self.getname()) | ||||
|             # Abort *this* account without doing any changes. | ||||
|             # Other accounts are not affected. | ||||
|             return | ||||
|  | ||||
|         # Loop account sync if needed (bail out after 3 failures). | ||||
|         looping = 3 | ||||
|         while looping: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user