Exemple #1
0
        public void ImportDB(IMirandaDB db)
        {
            _updatedConversations = new IntHashSet();
            _db = db;

            if (_db.FileSize == _lastFileSize && _db.SlackSpace == _lastSlackSpace)
            {
                TraceImport("Skipping Miranda DB import because file size and slack space did not change");
                _contactEnumerator = null;
                return;
            }
            _lastFileSize   = _db.FileSize;
            _lastSlackSpace = db.SlackSpace;

            ImportContact(_db.UserContact, true);
            if (_selfContact == null)
            {
                _selfContact = Core.ContactManager.MySelf.Resource;
            }

            // for AIM, we cannot create the contact resource from
            // the account, so hook the contact to the account later
            foreach (IResource acct in _selfAccounts.Values)
            {
                if (!acct.HasLink(Props.MirandaAcct, _selfContact))
                {
                    acct.AddLink(Props.MirandaAcct, _selfContact);
                }
            }

            _contactIndex      = 0;
            _contactEnumerator = _db.Contacts.GetEnumerator();
        }
Exemple #2
0
        private void DoImportDB(IMirandaDB db)
        {
            IMConversationsManager convManager = new IMConversationsManager(
                ResourceTypes.MirandaConversation, "Miranda Conversation", "Subject",
                IniSettings.ConversationPeriodTimeSpan,
                Props.MirandaAcct, Props.FromAccount, Props.ToAccount, null);

            MirandaImportJob importJob = new MirandaImportJob("", convManager, null);

            importJob.ImportDB(db);
            while (true)
            {
                AbstractJob job = importJob.GetNextJob();
                if (job == null)
                {
                    break;
                }
                job.NextMethod.Invoke();
            }
            importJob.EnumerationFinished();
        }