OP_STATUS GroupsModel::Init(UINT16 account_id, BOOL read_only) { m_account_id = account_id; m_read_only = read_only; Account* account = MessageEngine::GetInstance()->GetAccountById(account_id); if (account) { RETURN_IF_ERROR(MessageEngine::GetInstance()->AddAccountListener(this)); switch (account->GetIncomingProtocol()) { case AccountTypes::NEWS: m_folder_type = OpTypedObject::NEWSGROUP_TYPE; break; case AccountTypes::IMAP: m_folder_type = OpTypedObject::IMAPFOLDER_TYPE; break; case AccountTypes::RSS: m_folder_type = OpTypedObject::NEWSFEED_TYPE; break; case AccountTypes::IRC: m_folder_type = OpTypedObject::CHATROOM_TYPE; break; } account->GetAllFolders(); } return OpStatus::OK; }