Commit aa861d80 by Kim Jinsung

Bug #44478【ABook Communication Android】プッシュメッセージ一覧からルーム接続及び協業接続できない。

parent 85a0b2c6
......@@ -1012,4 +1012,57 @@ public class CommunicationLogic extends AbstractLogic {
public void updateUnreadCount(List<ChatMessageDto> messageList, String roomId) {
chatMessageDao.updatUnreadCount(messageList, roomId);
}
/**
* 協業招待メッセージからCollaborationTypeを取得 (招待文字列比較)
* @param message プッシュメッセージ
* @return 協業タイプ
*/
public String getCollaborationType(String message) {
try {
if (message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.EN) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.JP) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.KR)) {
return collaborationTypeToNum(message);
}
return null;
} catch (Exception e) {
return null;
}
}
/**
* 協業招待メッセージからCollaborationTypeを取得(各協業文字列比較)
* @param message プッシュメッセージ
* @return 協業タイプ
*/
public String collaborationTypeToNum(String message) {
if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_CAMERA.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.CAMERA);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_VIDEO.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.VIDEO);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_DOCUMENT.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.DOCUMENT);
}else if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.EN) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.JP) ||
message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_BOARD.KR)
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.BOARD);
}
return null;
}
}
......@@ -65,6 +65,7 @@ import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.BookmarkLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.MemoLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
......@@ -120,6 +121,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected BookmarkLogic bookmarkLogic = AbstractLogic.getLogic(BookmarkLogic.class);
protected ContentDownloader contentDownloader = ContentDownloader.getInstance();
protected ContentRefresher contentRefresher = ContentRefresher.getInstance();
private final CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
private ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用
......@@ -971,7 +973,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
if(dto.roomName != null && dto.roomId != 0)
{
pushMessageLogic.updateReadingFlg(dto.pushMessageId);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto);
String collaborationType = communicationLogic.getCollaborationType(dto.pushMessage);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithPushMessage(dto, collaborationType);
mPushMessageListDialog.dismiss();
} else {
showPushMessageDetailView(dto);
......
......@@ -256,7 +256,10 @@ public class ChatWebViewActivity extends CommunicationWebViewActivity implements
}
Integer integerRoomId = Integer.parseInt(chatData.roomId.toString());
if (StringUtil.isNullOrEmpty(chatData.roomType)) {
chatData.roomType = communicationLogic.getChatRoom(integerRoomId).type.toString();
ChatRoomDto dto = communicationLogic.getChatRoom(integerRoomId);
if (dto != null) {
chatData.roomType = dto.type.toString();
}
}
if (StringUtil.isNullOrEmpty(chatData.getStrCollaborationType())) {
String parameterData = "sid=" + chatData.sid
......
......@@ -1644,24 +1644,12 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
//プシュメッセージ一覧からチャットに入る
public void startChatWebViewActivityWithPushMessage(PushMessageDto dto) {
String className = ChatWebViewActivity.class.getName();
Intent intent = new Intent();
intent.putExtra("chatWebviewUrl",ABVEnvironment.getInstance().acmsAddress + ABVDataCache.getInstance().getUrlPath() + "/chatapi/chat/");
String sid = ABVDataCache.getInstance().getMemberInfo().sid;
intent.putExtra("sid", sid);
String loginId = ABVDataCache.getInstance().getMemberInfo().loginId;
String shopName = ABVDataCache.getInstance().getUrlPath();
intent.putExtra(AppDefType.ChatPushMessageKey.loginId, loginId);
intent.putExtra(AppDefType.ChatPushMessageKey.shopName, shopName);
if (dto != null) {
intent.putExtra(AppDefType.ChatPushMessageKey.loginId, dto.roomId);
intent.putExtra(AppDefType.ChatPushMessageKey.roomName, dto.roomName);
public void startChatWebViewActivityWithPushMessage(PushMessageDto dto, String collaborationType) {
if (collaborationType == null) {
startChatWebViewActivity(dto.roomId, dto.roomName, ChatWebViewActivity.class.getName(), null);
} else {
startChatWebViewActivityWithCollaboration(dto.roomId, dto.roomName, collaborationType, null, ChatWebViewActivity.class.getName(), null);
}
intent.setClassName(mContext.getPackageName(), className);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
getCurrentActivity().startActivity(intent);
}
//チャットに入る
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment