Ok, I solved it, but now I can't save the jabber account to my user profile. I'm attaching my code which should create new jabber account, save it to profile and connect to it (commented last line). But it doesn't work :(
Jan Kaláb napsal(a): > Hi, > I'd like to create a Jabber account next to the wengo/sip account > during startup. I know all jabber account settings, and I guess I > just want to copy QtJabberSettings::setIMAccount() function. But > what is the _imAccount thing? Compiler still complains about > "‘_imAccount’ was not declared in this scope" but I don't know where > to find it. I tried some includes, but none helped. > > Thanks for your help. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > QuteCom-dev mailing list > [email protected] > http://lists.qutecom.org/mailman/listinfo/qutecom-dev
/*Connect to Jabber*/
IMAccount jabberAccount = IMAccount(EnumIMProtocol::IMProtocolJabber);
std::string imAccountParametersData = UserProfileFileStorage::loadSystemIMAccountParametersData();
IMAccountParametersXMLSerializer serializer(jabberAccount.getIMAccountParameters());
serializer.unserializeSystemSettings(imAccountParametersData);
jabberAccount.setLogin("[EMAIL PROTECTED]/voipex");
jabberAccount.setPassword("my-secret-password");
static const std::string connectserver = "jabber.cz";
IMAccountParameters & params = jabberAccount.getIMAccountParameters();
params.set(IMAccountParameters::JABBER_USE_TLS_KEY, true);
params.set(IMAccountParameters::JABBER_REQUIRE_TLS_KEY, true);
params.set(IMAccountParameters::JABBER_USE_OLD_SSL_KEY, false);
params.set(IMAccountParameters::JABBER_AUTH_PLAIN_IN_CLEAR_KEY, false);
params.set(IMAccountParameters::JABBER_CONNECTION_SERVER_KEY, connectserver);
params.set(IMAccountParameters::JABBER_PORT_KEY, 5222);
UserProfile userProfile;
userProfile.addIMAccount(jabberAccount);
//userProfile.getConnectHandler().connect(jabberAccount.getUUID()); //this causes crashes
signature.asc
Description: OpenPGP digital signature
_______________________________________________ QuteCom-dev mailing list [email protected] http://lists.qutecom.org/mailman/listinfo/qutecom-dev
