@@ -253,6 +253,10 @@ function getGroupMembers(offset, count, callback)
253253{
254254 var action = "api.group.members" ;
255255 var groupId = localStorage . getItem ( chatSessionIdKey ) ;
256+ var type = localStorage . getItem ( groupId ) ;
257+ if ( type == U2_MSG ) {
258+ return ;
259+ }
256260 var reqData = {
257261 "groupId" : groupId ,
258262 "offset" : offset ,
@@ -409,10 +413,13 @@ function initSpeakerGroupMemberList(results)
409413 var isType = "member" ;
410414
411415 if ( groupOwnerId == userId ) {
412- isType = "owner"
416+ isType = "owner" ;
417+ continue ;
413418 }
414419 if ( groupAdminIds && groupAdminIds . indexOf ( userId ) != - 1 ) {
415420 isType = "admin" ;
421+ continue ;
422+
416423 }
417424
418425 if ( speakerListMemberIds && speakerListMemberIds . indexOf ( userId ) != - 1 ) {
@@ -782,10 +789,10 @@ function initGroupList(results)
782789{
783790 $ ( ".group-lists" ) . html ( "" ) ;
784791 var html = template ( "tpl-create-group" , { } ) ;
792+ html = handleHtmlLanguage ( html ) ;
785793 $ ( ".group-lists" ) . html ( html ) ;
786794
787795 if ( results . hasOwnProperty ( "list" ) ) {
788-
789796 getGroupListHtml ( results ) ;
790797 }
791798}
@@ -878,11 +885,14 @@ $(document).on("click", ".see_group_profile", function () {
878885 $ ( this ) . attr ( "is_show_profile" , 1 ) ;
879886 if ( chatSessionType == U2_MSG ) {
880887 sendFriendProfileReq ( chatSessionId ) ;
881- } else {
888+ $ ( '.right-body-sidebar' ) . show ( ) ;
889+ } else if ( chatSessionType == GROUP_MSG ) {
882890 getGroupMembers ( 0 , 18 , displayGroupMemberForGroupInfo ) ;
883891 sendGroupProfileReq ( chatSessionId , handleGetGroupProfile ) ;
892+ $ ( '.right-body-sidebar' ) . show ( ) ;
893+ } else {
894+ $ ( '.right-body-sidebar' ) . hide ( ) ;
884895 }
885- $ ( '.right-body-sidebar' ) . show ( ) ;
886896 }
887897} ) ;
888898
@@ -945,8 +955,8 @@ function addGroupMemberToGroupMemberList(result)
945955 groupMemberListAdmins . push ( admin . userId ) ;
946956 }
947957 }
958+ getGroupMembers ( groupMemberListOffset , defaultCountKey , initGroupMemberForGroupMemberList ) ;
948959 }
949- getGroupMembers ( groupMemberListOffset , defaultCountKey , initGroupMemberForGroupMemberList ) ;
950960}
951961
952962function handleGetGroupMemberInfo ( result )
@@ -1072,15 +1082,16 @@ $(document).on("click", ".group-profile", function () {
10721082function handleGetGroupProfileByClick ( results )
10731083{
10741084 var groupProfile = results . profile ;
1075-
10761085 if ( groupProfile == null ) {
10771086 alert ( "此群已经被解散" ) ;
10781087 var chatSessionId = localStorage . getItem ( chatSessionIdKey ) ;
10791088 localStorage . removeItem ( roomKey + chatSessionId ) ;
10801089 removeRoomFromRoomList ( chatSessionId ) ;
10811090 } else {
1082- handleGetGroupProfile ( results ) ;
1091+ getGroupMembers ( 0 , 18 , displayGroupMemberForGroupInfo ) ;
10831092 }
1093+ handleGetGroupProfile ( results ) ;
1094+
10841095}
10851096// contact-row-u2-profile
10861097$ ( document ) . on ( "click" , ".contact-row-group-profile" , function ( ) {
@@ -1141,7 +1152,7 @@ $(document).on("click", ".chatsession-row", function(){
11411152 var roomType = $ ( this ) . attr ( "roomType" ) ;
11421153 if ( roomType == U2_MSG ) {
11431154 getFriendProfileByClickChatSessionRow ( $ ( this ) ) ;
1144- } else {
1155+ } else if ( roomType == GROUP_MSG ) {
11451156 getGroupProfileByClickChatSessionRow ( $ ( this ) ) ;
11461157 }
11471158} ) ;
@@ -1168,7 +1179,6 @@ function handleMsgRelation(jqElement, chatSessionId)
11681179 getMsgFromRoom ( chatSessionId ) ;
11691180 syncMsgForRoom ( ) ;
11701181 displayCurrentProfile ( ) ;
1171- displayRightPage ( DISPLAY_CHAT ) ;
11721182}
11731183
11741184function judgeDefaultChat ( )
@@ -1668,6 +1678,7 @@ function groupCreateSuccess(results) {
16681678 } ) ;
16691679
16701680 $ ( ".chatsession-title" ) . html ( groupName ) ;
1681+ getGroupMembers ( 0 , 18 , displayGroupMemberForGroupInfo ) ;
16711682 handleGetGroupProfile ( results ) ;
16721683 insertGroupRoom ( groupProfile . id , groupProfile . name ) ;
16731684 handleMsgRelation ( undefined , groupProfile . id ) ;
@@ -1712,7 +1723,6 @@ function handleClickGroupUserImg(results)
17121723 var memberIsAdmin = checkGroupMemberAdminType ( clickImgUserId , groupProfile ) ;
17131724 var memberIsSpeaker = checkGroupMemberSpeakerType ( clickImgUserId , groupProfile ) ;
17141725 var memberIsOwner = checkGroupOwnerType ( clickImgUserId , groupProfile ) ;
1715- console . log ( "memberIsOwner====" + memberIsOwner ) ;
17161726 var isFriend = localStorage . getItem ( friendRelationKey + clickImgUserId ) == FriendRelation . FriendRelationFollow ? 1 : 0 ;
17171727 var html = template ( "tpl-group-user-menu" , {
17181728 userId : clickImgUserId ,
@@ -1729,7 +1739,6 @@ function handleClickGroupUserImg(results)
17291739 $ ( node ) . append ( $ ( html ) ) ;
17301740 }
17311741 handleGetGroupProfile ( results ) ;
1732-
17331742}
17341743
17351744$ ( document ) . on ( "click" , ".group-user-img" , function ( ) {
@@ -1942,6 +1951,7 @@ function updateInfo(profileId, profileType)
19421951 }
19431952 $ ( ".nickname_" + profileId ) . html ( name ) ;
19441953 $ ( ".chatsession-row .nickname_" + profileId ) . html ( subName ) ;
1954+
19451955 try {
19461956 if ( mute > 0 ) {
19471957 $ ( ".room-chatsession-mute_" + profileId ) [ 0 ] . style . display = "block" ;
@@ -1952,6 +1962,7 @@ function updateInfo(profileId, profileType)
19521962 }
19531963}
19541964
1965+
19551966function displayCurrentProfile ( )
19561967{
19571968 try {
@@ -2009,7 +2020,7 @@ function displayCurrentProfile()
20092020 $ ( ".friend_mute" ) . attr ( "is_on" , "off" ) ;
20102021 }
20112022
2012- } else {
2023+ } else if ( chatSessionType == GROUP_MSG ) {
20132024 $ ( ".group-profile-desc" ) [ 0 ] . style . visibility = "visible" ;
20142025 $ ( ".group-profile-desc" ) [ 0 ] . style . width = "100%" ;
20152026 $ ( ".user-profile-desc" ) [ 0 ] . style . visibility = "hidden" ;
@@ -2058,7 +2069,6 @@ function displayCurrentProfile()
20582069 } catch ( error ) {
20592070
20602071 }
2061- getGroupMembers ( 0 , 18 , displayGroupMemberForGroupInfo ) ;
20622072
20632073 try {
20642074 var permissionJoin = groupProfile . permissionJoin ;
@@ -2119,6 +2129,7 @@ function displayCurrentProfile()
21192129 $ ( ".mark-down-group" ) [ 0 ] . style . display = "none" ;
21202130 break ;
21212131 }
2132+
21222133 } catch ( error ) {
21232134
21242135 }
@@ -2146,6 +2157,7 @@ function displayCurrentProfile()
21462157 }
21472158 $ ( "." + chatSessionId ) . addClass ( "chatsession-row-active" ) ;
21482159 updateInfo ( chatSessionId , chatSessionType ) ;
2160+ displayRightPage ( DISPLAY_CHAT ) ;
21492161 } catch ( error ) {
21502162 // console.log(error.message)
21512163 }
@@ -3099,6 +3111,12 @@ function updateGroupNameName(event)
30993111 var groupName = $ ( "#groupName" ) . val ( ) ;
31003112 var groupId = localStorage . getItem ( chatSessionIdKey ) ;
31013113
3114+ if ( groupName . length > 10 || groupName . length < 1 ) {
3115+ var tip = $ . i18n . map [ 'createGroupNameTip' ] != undefined ? $ . i18n . map [ 'createGroupNameTip' ] : "群组名称长度限制1-10" ;
3116+ alert ( tip ) ;
3117+ return ;
3118+ }
3119+
31023120 var values = {
31033121 type : ApiGroupUpdateType . ApiGroupUpdateName ,
31043122 writeType :DataWriteType . WriteUpdate ,
@@ -3116,7 +3134,6 @@ function updateGroupNameName(event)
31163134
31173135$ ( document ) . on ( "click" , ".web-msg-click" , function ( ) {
31183136 var url = $ ( this ) . attr ( "src-data" ) ;
3119- console . log ( url ) ;
31203137 window . open ( url ) ;
31213138} ) ;
31223139
0 commit comments