Hi Vadim
I think following will be a little bit safer:
>
> void UserProfileHandler::readyForEvents()
> {
> if (_readyForEvents==false)
> {
> _readyForEvents=true;
> _currentUserProfile->readyForEvents();
> IMWrapperFactory::getFactory().startGaimFactory();
> LOG_DEBUG("Connecting enabled!");
> }
> }
>
>
>
> Thanks
> Vadim
>
> >
> >
I don't think so => With my version the UserProfile-Switch also works!
In your it would not.
_currentUserProfile->readyForEvents() does nothing than SET the
_readyForEvents variable in the ConnectionHandler of the current
UserProfile to true. Because the Connection-Handler was waiting before
for _readyForEvents to be set true this won't affect the UserProfile if
it is already set to true.
=> The login-functions are in an idle-mode until the var is set to true.
And this is exactly what I think not to be clean in my solution. But it
was the fastest way for me to test what gives me the error and to fix
it. Have a look at this, whats the head of:
void ConnectHandler::connect(IMAccount & imAccount) {
void ConnectHandler::newIMAccountAddedEventHandler(UserProfile & sender,
IMAccount & imAccount) {
void ConnectHandler::connectionIsUpEventHandlerThreadSafe() {
while (_userProfile.getReadyForEvents()==false)
{
Thread::sleep(1);
}
I should perhaps metion that I'm doing the same after connection loss
like if you would log off and then log-in again => resetting the whole
profile. This is because our server automatically removes a user after a
certain offline time from the sip-server and has be created again, what
happens automatically on loging in. This is why I needed to put this
into all the mentioned functions in ConnectionHandler.cpp
_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel