Commit 47084337 by Kim Jinsung

Merge branch 'communication/develop_kimjs' into 'communication/develop'

協業開始でも協業接続される問題対応

See merge request !235
parents ecf3d7bb 2e2ff3c5
...@@ -166,29 +166,29 @@ public interface ABookCommConstants { ...@@ -166,29 +166,29 @@ public interface ABookCommConstants {
String KR = "\ud611\uc5c5"; String KR = "\ud611\uc5c5";
} }
interface COLLABORATION_AUDIO { interface COLLABORATION_AUDIO {
String EN = "audio"; String EN = "audio collaboration";
String JP = "\u901a\u8a71"; String JP = "通話協業";
String KR = "\ud1b5\ud654"; String KR = "통화협업";
} }
interface COLLABORATION_CAMERA { interface COLLABORATION_CAMERA {
String EN = "image"; String EN = "image collaboration";
String JP = "\u5199\u771f"; String JP = "写真協業";
String KR = "\uc0ac\uc9c4"; String KR = "사진협업";
} }
interface COLLABORATION_VIDEO { interface COLLABORATION_VIDEO {
String EN = "video"; String EN = "video collaboration";
String JP = "\u52d5\u753b"; String JP = "動画協業";
String KR = "\uc601\uc0c1"; String KR = "영상협업";
} }
interface COLLABORATION_DOCUMENT { interface COLLABORATION_DOCUMENT {
String EN = "document"; String EN = "document collaboration";
String JP = "\u6587\u66f8"; String JP = "文書協業";
String KR = "\ubb38\uc11c"; String KR = "문서협업";
} }
interface COLLABORATION_BOARD { interface COLLABORATION_BOARD {
String EN = "board"; String EN = "board collaboration";
String JP = "\u30dc\u30fc\u30c9"; String JP = "ボード協業";
String KR = "\ubcf4\ub4dc"; String KR = "보드협업";
} }
} }
......
...@@ -1014,55 +1014,41 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -1014,55 +1014,41 @@ public class CommunicationLogic extends AbstractLogic {
} }
/** /**
* 協業招待メッセージからCollaborationTypeを取得 (招待文字列比較) * 協業招待メッセージからCollaborationTypeを取得
* @param message プッシュメッセージ * @param message プッシュメッセージ
* @return 協業タイプ * @return 協業タイプ
*/ */
public String getCollaborationType(String message) { public String getCollaborationType(String message) {
try { try {
if (message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.EN) || if (message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.EN) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.JP) || message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.JP) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.KR)) { message.contains(ABookCommConstants.COLLABORATION.COLLABORATION_AUDIO.KR)
return collaborationTypeToNum(message); ) {
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; return null;
} catch (Exception e) { } catch (Exception e) {
return null; 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;
}
} }
...@@ -23,6 +23,7 @@ import jp.agentec.abook.abv.bl.common.exception.ABVException; ...@@ -23,6 +23,7 @@ import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.util.AppUtil; import jp.agentec.abook.abv.cl.util.AppUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
...@@ -45,6 +46,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -45,6 +46,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
private static final String TAG = "ABVFcmListenerService"; private static final String TAG = "ABVFcmListenerService";
private NotificationManager mNotificationManager; private NotificationManager mNotificationManager;
private static int mNotificationConnect = 0; private static int mNotificationConnect = 0;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
@Override @Override
public void onCreate() { public void onCreate() {
...@@ -146,7 +148,10 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -146,7 +148,10 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId()); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate()); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, json.getRoomType()); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, json.getRoomType());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, json.getCollaborationType()); String collaborationType = communicationLogic.getCollaborationType(json.getMessage());
if (collaborationType != null) {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
}
startActivity(pushMsgDialog); startActivity(pushMsgDialog);
} }
} }
...@@ -226,14 +231,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -226,14 +231,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
JSONObject json = new JSONObject(messageBody); JSONObject json = new JSONObject(messageBody);
String textMessage = json.getString(AppDefType.PushMessageKey.message); String textMessage = json.getString(AppDefType.PushMessageKey.message);
String roomType = ""; String roomType = "";
String collaborationType = "";
if (textMessage.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.EN) ||
textMessage.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.JP) ||
textMessage.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.KR)
) {
// roomType = Integer.toString(json.getInt(AppDefType.ChatPushMessageKey.roomType));
collaborationType = collaborationTypeToNum(textMessage);
}
String roomName = json.getString(AppDefType.ChatPushMessageKey.roomName); String roomName = json.getString(AppDefType.ChatPushMessageKey.roomName);
String pushMsg = json.getString(AppDefType.PushMessageKey.message); String pushMsg = json.getString(AppDefType.PushMessageKey.message);
message.put(AppDefType.PushMessageKey.message, pushMsg); message.put(AppDefType.PushMessageKey.message, pushMsg);
...@@ -253,42 +251,14 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -253,42 +251,14 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate); intent.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
intent.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType); intent.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
intent.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType); String collaborationType = communicationLogic.getCollaborationType(textMessage);
if (collaborationType != null) {
intent.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
}
return intent; return intent;
} }
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 String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO);
}
private Notification.Builder getNotificationBuilder(PendingIntent pendingIntent, Map<String, String> message) { private Notification.Builder getNotificationBuilder(PendingIntent pendingIntent, Map<String, String> message) {
String txtMessage = message.get(AppDefType.PushMessageKey.message); String txtMessage = message.get(AppDefType.PushMessageKey.message);
return new Notification.Builder(this) return new Notification.Builder(this)
......
...@@ -85,62 +85,4 @@ public class PushMessageJSON { ...@@ -85,62 +85,4 @@ public class PushMessageJSON {
return 0; return 0;
} }
} }
public boolean isCollaboration() {
String message = getMessage();
if (message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.EN) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.JP) ||
message.contains(ABookCommConstants.COLLABORATION.INVITE_COLLABORATION.KR)) {
return true;
}
return false;
}
public String getCollaborationType() {
try {
String message = getMessage();
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 jsonObject.getString(AppDefType.ChatPushMessageKey.collaborationType);
} catch (Exception e) {
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 String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.AUDIO);
}
} }
...@@ -1329,8 +1329,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1329,8 +1329,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId()); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate()); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, json.getRoomType()); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, json.getRoomType());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, json.getCollaborationType()); String collaborationType = communicationLogic.getCollaborationType(messageText);
if (collaborationType != null) {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
}
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, messageMap.get(AppDefType.ChatPushMessageKey.baseActivityName)); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.baseActivityName, messageMap.get(AppDefType.ChatPushMessageKey.baseActivityName));
String newVersion = messageMap.get(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen); String newVersion = messageMap.get(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
if (newVersion != null && newVersion.equals(new String("true"))) { if (newVersion != null && newVersion.equals(new String("true"))) {
...@@ -1338,7 +1340,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -1338,7 +1340,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} else { } else {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, false); pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, false);
} }
startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE); startActivityForResult(pushMsgDialog, ABookCommConstants.PUSH_MESSAGE_DLG_REQUEST_CODE);
} }
} }
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