diff --git a/apps/common/mobile/lib/controller/ContextMenu.jsx b/apps/common/mobile/lib/controller/ContextMenu.jsx index 5f5509cb0..8a91b862e 100644 --- a/apps/common/mobile/lib/controller/ContextMenu.jsx +++ b/apps/common/mobile/lib/controller/ContextMenu.jsx @@ -163,6 +163,8 @@ class ContextMenuController extends Component { } onApiShowForeignCursorLabel(UserId, X, Y, color) { + if (!this.isUserVisible(UserId)) return; + /** coauthoring begin **/ const tipHeight = 20; diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index 9bccbeee3..fadd14ca2 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -29,6 +29,7 @@ class ContextMenu extends ContextMenuController { this.onApiHideComment = this.onApiHideComment.bind(this); this.onApiShowChange = this.onApiShowChange.bind(this); this.getUserName = this.getUserName.bind(this); + this.isUserVisible = this.isUserVisible.bind(this); this.ShowModal = this.ShowModal.bind(this); } @@ -41,6 +42,11 @@ class ContextMenu extends ContextMenuController { return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName()); } + isUserVisible(id) { + const user = this.props.users.searchUserByCurrentId(id); + return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true; + } + componentWillUnmount() { super.componentWillUnmount(); diff --git a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx index 73615138b..374ea55a1 100644 --- a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx @@ -25,6 +25,7 @@ class ContextMenu extends ContextMenuController { this.onApiShowComment = this.onApiShowComment.bind(this); this.onApiHideComment = this.onApiHideComment.bind(this); this.getUserName = this.getUserName.bind(this); + this.isUserVisible = this.isUserVisible.bind(this); } static closeContextMenu() { @@ -36,6 +37,11 @@ class ContextMenu extends ContextMenuController { return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName()); } + isUserVisible(id) { + const user = this.props.users.searchUserByCurrentId(id); + return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true; + } + componentWillUnmount() { super.componentWillUnmount(); diff --git a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx index f57aebe28..619dad1c1 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx @@ -30,6 +30,7 @@ class ContextMenu extends ContextMenuController { this.isOpenWindowUser = false; this.timer; this.getUserName = this.getUserName.bind(this); + this.isUserVisible = this.isUserVisible.bind(this); this.onApiMouseMove = this.onApiMouseMove.bind(this); this.onApiHyperlinkClick = this.onApiHyperlinkClick.bind(this); } @@ -43,6 +44,11 @@ class ContextMenu extends ContextMenuController { return AscCommon.UserInfoParser.getParsedName(user.asc_getUserName()); } + isUserVisible(id) { + const user = this.props.users.searchUserByCurrentId(id); + return user ? (user.asc_getIdOriginal()===this.props.users.currentUser.asc_getIdOriginal() || AscCommon.UserInfoParser.isUserVisible(user.asc_getUserName())) : true; + } + componentWillUnmount() { super.componentWillUnmount(); @@ -277,7 +283,7 @@ class ContextMenu extends ContextMenuController { $$('.username-tip').remove(); } - if (index_locked ) { + if (index_locked && this.isUserVisible(dataarray[index_locked-1].asc_getUserId())) { const tipHeight = 20; let editorOffset = $$("#editor_sdk").offset(), XY = [ editorOffset.left - $(window).scrollLeft(), editorOffset.top - $(window).scrollTop()],