*/
private void getGroupsInfo() throws IllegalResponseException, RequestTimeoutException, TransferException, SystemException, InterruptedException
{
ActionEventFuture future = new ActionEventFuture();
ActionEventListener listener = new FutureActionEventListener(future);
ServerDialog dialog = this.context.getDialogFactory().getServerDialog();
StoreVersion storeVersion = this.context.getFetionStore().getStoreVersion();
StoreVersion userVersion = this.context.getFetionUser().getStoreVersion();
this.updateLoginState(LoginState.GET_GROUPS_INFO_DOING, null);
//获取群列表
future.clear();
dialog.getGroupList(listener);
Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
//如果群列表为空,就不发送下面的一些请求了
FetionStore store = this.context.getFetionStore();
if(store.getGroupList().size()==0){
logger.debug("The group list is empty, group dialog login is skipped.");
return;
}
//如果当前存储版本和服务器相同,就不获取群信息和群成员列表,
//TODO ..这里只是解决了重新登录的问题,事实上这里问题很大,群信息分成很多
//用户加入的群列表 groupListVersion
//某群的信息 groupInfoVersion
//群成员列表 groupMemberListVersion
//暂时就这样,逐步完善中.....
logger.debug("GroupListVersion: server="+userVersion.getGroupVersion()+", local="+storeVersion.getGroupVersion());
if(storeVersion.getGroupVersion()!=userVersion.getGroupVersion()) {
//更新存储版本
storeVersion.setGroupVersion(userVersion.getGroupVersion());
//获取群信息
future.clear();
dialog.getGroupsInfo(this.context.getFetionStore().getGroupList(), listener);
Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
//获取群成员
future.clear();
dialog.getMemberList(this.context.getFetionStore().getGroupList(), listener);
Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
storeVersion.setGroupVersion(userVersion.getGroupVersion());
}