Change status to offline for all chat rooms belonging to a given account when it goes offline.

git-svn-id: http://yate.null.ro/svn/yate/trunk@4012 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2010-12-22 15:41:38 +00:00
parent fd6af43b74
commit 2ab186d22d
1 changed files with 17 additions and 0 deletions

View File

@ -2201,6 +2201,22 @@ static void removePendingChat(const String& id, ClientAccountList* accounts = 0)
room->flashChat(id,false);
}
// Set offline to MUCs belonging to a given account
static void setOfflineMucs(ClientAccount* acc)
{
if (!acc || Client::exiting())
return;
for (ObjList* o = acc->mucs().skipNull(); o; o = o->skipNext()) {
MucRoom* room = static_cast<MucRoom*>(o->get());
if (room->resource().offline())
continue;
room->resource().m_status = ClientResource::Offline;
room->resource().m_affiliation = MucRoomMember::AffNone;
room->resource().m_role = MucRoomMember::RoleNone;
updateMucRoomMember(*room,room->resource());
}
}
/**
* ClientWizard
@ -5257,6 +5273,7 @@ bool DefaultLogic::handleUserNotify(Message& msg, bool& stopLogic)
acc->resource().m_id = acc->m_params.getValue("resource");
}
clearAccountContacts(*acc);
setOfflineMucs(acc);
}
// Clear some internal params
acc->m_params.clearParam("internal.nologinfail");