Skip to content

Commit cc67cb7

Browse files
committed
fix alert group disband, not member, fix invitation code
1 parent 0cba373 commit cc67cb7

10 files changed

Lines changed: 63 additions & 36 deletions

File tree

src/controller/Api/Passport/Api_Passport_PasswordUpdateInvitationCodeController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function rpc(\Google\Protobuf\Internal\Message $request, \Google\Protobuf
3535
throw new Exception("sitePubkPem is not exists");
3636
}
3737

38-
if(!$invitationCode || strlen($invitationCode) < 0 ) {
38+
if(strlen($invitationCode) < 0 ) {
3939
$errorCode = $this->zalyError->errorUpdateInvitation;
4040
$errorInfo = $this->zalyError->getErrorInfo($errorCode);
4141
$this->setRpcError($errorCode, $errorInfo);
@@ -95,7 +95,6 @@ public function updateUserInfo($preSessionId, $invitationCode, $sitePubkPem)
9595
$this->ctx->PassportPasswordPreSessionTable->updatePreSessionData($updatePreSessionWhere, $preSessionInfo);
9696

9797
$this->ctx->BaseTable->db->commit();
98-
9998
return $newPreSessionId;
10099
}catch (Exception $ex) {
101100
$this->ctx->Wpf_Logger->error($tag, "error_msg=" . $ex->getMessage());

src/public/css/zaly_msg.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ html, body{
670670
overflow-y: scroll;
671671
}
672672
.sub-speaker-title {
673-
width:10.69rem;
674673
height:1.88rem;
675674
font-size:1.31rem;
676675
font-family:PingFangSC-Medium;

src/public/js/config/lang.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ groupAdminInvitationTip=管理员邀请
2121
groupMemberInvitationTip=群成员邀请
2222
groupMemberTip=群成员
2323
allGroupMemberTip=查看全部
24+
otherGroupMemberTip=其他成员
2425
groupPublicTip=公开
2526
saveTip=保存
2627
canGuestReadMsgTip=游客是否可以阅读群消息

src/public/js/config/lang_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ groupAdminInvitationTip=Admin Invitation
2121
groupMemberInvitationTip=Member Invitation
2222
groupMemberTip=Members List
2323
allGroupMemberTip=All Members
24+
otherGroupMemberTip=Other Group Members
2425
groupPublicTip=public
2526
saveTip=Save
2627
canGuestReadMsgTip=Guest Can Read Msg

src/public/js/config/lang_zh.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ groupAdminInvitationTip=管理员邀请
2121
groupMemberInvitationTip=群成员邀请
2222
groupMemberTip=群成员
2323
allGroupMemberTip=查看全部
24+
otherGroupMemberTip=其他成员
2425
groupPublicTip=公开
2526
saveTip=保存
2627
canGuestReadMsgTip=游客是否可以阅读群消息

src/public/js/im/zalyGroupMsg.js

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

952962
function handleGetGroupMemberInfo(result)
@@ -1072,15 +1082,16 @@ $(document).on("click", ".group-profile", function () {
10721082
function 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

11741184
function 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+
19551966
function 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

src/public/js/im/zalyMsg.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ function getRoomList()
2121
var i;
2222
for(i=0;i <length; i++) {
2323
var msg = roomList[i];
24+
msg = handleMsgInfo(msg);
2425
if(!currentChatSessionId && i==length-1) {
2526
localStorage.setItem(chatSessionIdKey, msg.chatSessionId);
27+
currentChatSessionId = msg.chatSessionId;
2628
}
2729
if( msg.chatSessionId == currentChatSessionId) {
28-
localStorage.setItem( msg.chatSessionId, msg.roomType);
30+
localStorage.setItem(msg.chatSessionId, msg.roomType);
2931
}
30-
msg = handleMsgInfo(msg);
3132
appendOrInsertRoomList(msg, false, false);
3233
}
3334
displayCurrentProfile();
34-
displayRightPage(DISPLAY_CHAT);
3535
msgBoxScrollToBottom();
3636
}
3737

@@ -215,6 +215,7 @@ function appendOrInsertRoomList(msg, isInsert, showNotification)
215215

216216
if(msg.chatSessionId == localStorage.getItem(chatSessionIdKey)) {
217217
$(".chat_session_id_"+msg.chatSessionId).addClass("chatsession-row-active");
218+
displayCurrentProfile();
218219
}
219220
if(msg.fromUserId != token && showNotification) {
220221
showWebNotification(msg, msgContent);
@@ -383,7 +384,6 @@ function handleSyncMsgForRoom(results)
383384
}
384385
}
385386
}catch (error) {
386-
console.log("error msg ==" + error.message);
387387
isSyncingMsg = false;
388388
}
389389
}
@@ -1097,7 +1097,6 @@ function uploadMsgFileFromInput(obj, fileType) {
10971097
size:obj.files.item(0).size,
10981098
name:obj.files.item(0).name
10991099
};
1100-
console.log("file info ==" + JSON.stringify(params));
11011100
uploadMsgFileToServer(formData, src, uploadFileForMsg, params);
11021101
} else if(fileType == FileType.FileImage) {
11031102
getMsgImageSize(src);
@@ -1247,7 +1246,6 @@ function uploadMsgFileToServer(formData, src, type, params)
12471246
}
12481247
},
12491248
error:function(err){
1250-
console.log("file upload failed");
12511249
alert("发送失败,稍后重试");
12521250
return false;
12531251
}

src/public/js/login/login.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,13 @@ function zalyLoginConfig(results) {
9090
}
9191

9292

93-
function loginFailed()
93+
function loginFailed(result)
9494
{
95-
zalyjsAlert("登录失败");
95+
zalyjsAlert(result);
96+
if(isRegister == true && enableInvitationCode == 1) {
97+
$(".register_button").attr("is_type", updateInvitationCodeType);
98+
apiPassportPasswordLogin(failedApiPassportPasswordLogin);
99+
}
96100
}
97101

98102
getOsType();
@@ -356,7 +360,7 @@ function registerAndLogin()
356360
invitationCode = $(".register_input_code").val();
357361

358362
if(isType == updateInvitationCodeType) {
359-
updatePassportPassword();
363+
updatePassportPasswordInvitationCode();
360364
} else {
361365
var flag = checkRegisterInfo();
362366
if(flag == false) {
@@ -380,10 +384,10 @@ function failedApiPassportPasswordLogin(results) {
380384

381385
$(document).on("click", ".update_code_btn", function () {
382386
invitationCode = $(".update_input_code").val();
383-
updatePassportPassword();
387+
updatePassportPasswordInvitationCode();
384388
});
385389

386-
function updatePassportPassword()
390+
function updatePassportPasswordInvitationCode()
387391
{
388392
var action = "api.passport.passwordUpdateInvitationCode";
389393
var reqData = {
@@ -476,17 +480,25 @@ function loginPassport()
476480
function apiPassportPasswordLogin(callback)
477481
{
478482
var action = "api.passport.passwordLogin";
479-
var reqData = {
480-
loginName:loginName,
481-
password:loginPassword,
482-
sitePubkPem:sitePubkPem,
483-
};
483+
484+
if(isRegister == true) {
485+
var reqData = {
486+
loginName:registerLoginName,
487+
password:registerPassword,
488+
sitePubkPem:sitePubkPem,
489+
};
490+
} else {
491+
var reqData = {
492+
loginName:loginName,
493+
password:loginPassword,
494+
sitePubkPem:sitePubkPem,
495+
};
496+
}
484497
handleClientSendRequest(action, reqData, callback);
485498
}
486499

487500
function handleApiPassportPasswordLogin(results)
488501
{
489-
isRegister = false;
490502
preSessionId = results.preSessionId;
491503
zalyjsLoginSuccess(loginName, preSessionId, isRegister, loginFailNeedRegister);
492504
}

src/views/base/chatDialog.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
139139
<div style="position: relative">
140140
<div class="group-profile-desc">
141-
142141
<div class="group-desc">
143142
<div class="group-desc-title" style="position: relative" data-local-value="groupMemberTip">群成员</div>
144143
<div class="group-member-body">

src/views/base/template_msg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@
547547
<script id="tpl-group-member-for-speaker" type="text/html">
548548
<div class="speaker-group-member">
549549
<div class="sub-speaker-div">
550-
<div class="sub-speaker-title" data-local-value="allGroupMemberTip"> 群成员 </div>
550+
<div class="sub-speaker-title" data-local-value="otherGroupMemberTip"> 其他成员 </div>
551551
</div>
552552
<div class="speaker-line"></div>
553553
<div class="speaker-group-member-div" style="width: 100%;">

0 commit comments

Comments
 (0)