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 {
String KR = "\ud611\uc5c5";
}
interface COLLABORATION_AUDIO {
String EN = "audio";
String JP = "\u901a\u8a71";
String KR = "\ud1b5\ud654";
String EN = "audio collaboration";
String JP = "通話協業";
String KR = "통화협업";
}
interface COLLABORATION_CAMERA {
String EN = "image";
String JP = "\u5199\u771f";
String KR = "\uc0ac\uc9c4";
String EN = "image collaboration";
String JP = "写真協業";
String KR = "사진협업";
}
interface COLLABORATION_VIDEO {
String EN = "video";
String JP = "\u52d5\u753b";
String KR = "\uc601\uc0c1";
String EN = "video collaboration";
String JP = "動画協業";
String KR = "영상협업";
}
interface COLLABORATION_DOCUMENT {
String EN = "document";
String JP = "\u6587\u66f8";
String KR = "\ubb38\uc11c";
String EN = "document collaboration";
String JP = "文書協業";
String KR = "문서협업";
}
interface COLLABORATION_BOARD {
String EN = "board";
String JP = "\u30dc\u30fc\u30c9";
String KR = "\ubcf4\ub4dc";
String EN = "board collaboration";
String JP = "ボード協業";
String KR = "보드협업";
}
}
......
......@@ -1014,28 +1014,12 @@ public class CommunicationLogic extends AbstractLogic {
}
/**
* 協業招待メッセージからCollaborationTypeを取得 (招待文字列比較)
* 協業招待メッセージから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)
......@@ -1062,7 +1046,9 @@ public class CommunicationLogic extends AbstractLogic {
) {
return String.valueOf(ABookCommConstants.FLAG.COLLABORATION_TYPE.BOARD);
}
return null;
} catch (Exception e) {
return null;
}
}
}
......@@ -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.dto.MemberInfoDto;
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.cl.util.AppUtil;
import jp.agentec.abook.abv.launcher.android.R;
......@@ -45,6 +46,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
private static final String TAG = "ABVFcmListenerService";
private NotificationManager mNotificationManager;
private static int mNotificationConnect = 0;
private CommunicationLogic communicationLogic = AbstractLogic.getLogic(CommunicationLogic.class);
@Override
public void onCreate() {
......@@ -146,7 +148,10 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
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);
}
}
......@@ -226,14 +231,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
JSONObject json = new JSONObject(messageBody);
String textMessage = json.getString(AppDefType.PushMessageKey.message);
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 pushMsg = json.getString(AppDefType.PushMessageKey.message);
message.put(AppDefType.PushMessageKey.message, pushMsg);
......@@ -253,40 +251,12 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId);
intent.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
intent.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
String collaborationType = communicationLogic.getCollaborationType(textMessage);
if (collaborationType != null) {
intent.putExtra(AppDefType.ChatPushMessageKey.collaborationType, collaborationType);
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);
return intent;
}
private Notification.Builder getNotificationBuilder(PendingIntent pendingIntent, Map<String, String> message) {
......
......@@ -85,62 +85,4 @@ public class PushMessageJSON {
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
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, json.getPushSendLoginId());
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, json.getPushSendDate());
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));
String newVersion = messageMap.get(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen);
if (newVersion != null && newVersion.equals(new String("true"))) {
......@@ -1338,7 +1340,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} else {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.needsDisplayOperationOrOperationRelatedContentScreen, false);
}
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