Do not connect if we're not configured (otherwise a 'not connected' error pops up during the first app run).

This commit is contained in:
B. Petersen
2017-04-04 17:59:32 +02:00
parent eb2f2de29c
commit 8fa34e8659
@@ -230,7 +230,9 @@ public class ApplicationLoader extends Application {
// open() should be called before MessagesController.getInstance() as this also initilizes directories based upon getBlobdir().
File dbfile = new File(getFilesDirFixed(), "messenger.db");
MrMailbox.open(dbfile.getAbsolutePath());
MrMailbox.connect();
if( MrMailbox.isConfigured()!=0 ) {
MrMailbox.connect();
}
// create other default objects
SharedPreferences mainPreferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);