Skip to content

Commit

Permalink
update to version 3.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fanjiangwei7 committed Aug 5, 2024
1 parent a3a377f commit 82abce6
Show file tree
Hide file tree
Showing 31 changed files with 243 additions and 130 deletions.
11 changes: 11 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

[蓝莺IM](https://www.lanyingim.com/),是由美信拓扑团队研发的新一代即时通讯云服务,SDK设计简单集成方便,服务采用云原生技术和多云架构,私有云也可按月付费。

### v3.2.2 20240806
1.移除用户设置别名相关的展示机操作接口,针对联系人只保留昵称、用户名和 id信息。
2.更新选择切换按钮的样式。
3.修改群组隐藏详细的设计逻辑,用户设置了群昵称及个人昵称的情况下仍然使用设置的信息,只有使用用户名的情况下才进行隐藏。
4.修改群组设置页面的群用户名称展示逻辑,保证设置界面也可以正常使用隐藏群信息的用户名逻辑。
5.针对用户名密码错误的场景修改尝试自动登录时频繁弹出alert 错误提示的问题,改为使用Element 消息提示方式,减少客户手动点击频率。
6.修改 appid 输入错误的情况下 dns 的报错逻辑处理,保证登录时显著提示 appid 设置错误。
7.移除群组header信息栏中无用的@消息提示。
8.floo web sdk中新增禁言群用户的处理逻辑。
9.修改群组聊天框中输入栏的处理逻辑,可以正常的展示被禁言及收到长链接禁言通知后可以正确显示禁言状态。

### v3.2.1 20240801

1.修复 页面存储账号信息在从明文模式切换到加密模式时可能出现的兼容问题。
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ yarn mac
yarn win
```

### MAC ARM 运行提示
Apple M1 芯片上可能出现安装包无法运行的问题,需要执行如下命令行进行操作:
```
$ xattr -c <path/to/application.app>
```

### 开发自己的应用

请先修改美信拓扑 AppID
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@
"all": "node .electron-vue/build.js && electron-builder",
"w": "node .electron-vue/build.js"
},
"version": "3.2.1"
"version": "3.2.2"
}
2 changes: 1 addition & 1 deletion src/renderer/im/floo-3.0.0.js

Large diffs are not rendered by default.

Binary file modified src/renderer/image/im_packup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/renderer/image/sw_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/renderer/image/sw_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/renderer/ui/chatting/contact/conContact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="list" v-show="rosterShow">
<div @click="touchRoster(roster.user_id)" class="item" v-bind:key="roster.user_id" v-for="roster in getRosterList">
<img :src="roster.avatar" class="avatar" />
<span class="name">{{ roster.alias || roster.nick_name || roster.username || roster.user_id }}</span>
<span class="name">{{ roster.nick_name || roster.username || roster.user_id }}</span>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/ui/chatting/content/group/chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default {
// }
config.mentionList.forEach((sx) => {
content = content.replace('{' + sx + '}', umaps[sx].alias || umaps[sx].username);
content = content.replace('{' + sx + '}', umaps[sx].nick_name || umaps[sx].username);
});
x.mentionStr = content;
}
Expand Down
36 changes: 3 additions & 33 deletions src/renderer/ui/chatting/content/group/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,18 @@
<span class="typing" style="padding-left: 20px; color: #ddd"></span>
<div class="delete_button" @click="deleteConversation(getSid)">删除会话</div>
</div>
<div class="mention_title" v-if="this.mentionMessage !== ''">
<span @click="closeMention" class="closer">x</span>
<span class="text">{{ mentionMessage }}</span>
</div>
</div>
</template>

<script>
import { mapGetters } from 'vuex';
import { toNumber } from '../../../third/tools';
export default {
name: 'GroupChat',
data() {
return {
mentionMessage: ''
};
},
mounted() {
this.$store.getters.im.on('onMentionMessage', (messages) => {
const { from, config } = messages;
const gid = this.getSid;
const toUid = toNumber(messages.to);
if (gid === toUid) {
if (config && config.mentionList && config.mentionList.length) {
// 如果有mention的
const uid = this.$store.getters.im.userManage.getUid();
const hasIndex = config.mentionList.findIndex((x) => x + '' === uid + '');
if (hasIndex > -1) {
const umaps = this.$store.getters.im.rosterManage.getAllRosterDetail();
const str = umaps[from].username + ' 在群中提到了您!';
this.mentionMessage = str;
}
}
////
}
});
return {};
},
mounted() {},
components: {},
computed: {
...mapGetters('content', ['getGroupInfo', 'getSid']),
Expand Down Expand Up @@ -72,12 +46,8 @@ export default {
this.$store.dispatch('content/actionSetType', {
sid: undefined
});
},
closeMention() {
this.mentionMessage = '';
this.$store.state.im.groupManage.consumeGroupAtStatus(this.getSid);
}
//finish
}
};
Expand Down
90 changes: 88 additions & 2 deletions src/renderer/ui/chatting/content/group/inputer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<span v-popover:tooltip.top="'发送文件'" @click="fileUploadClickHandler" class="ico file"></span>
<span v-popover:tooltip.top="'发送位置'" @click="locationClickHandler" class="ico location"></span>
</div>
<el-alert v-if="hasBan" title="您已被禁言,请联系管理员" type="info" center :closable="false"></el-alert>
<div class="input">
<textarea @keydown="textareaKeyDown" @keyup="textKeyUp" class="input_text" v-model="message" wrap="hard"></textarea>
<textarea v-if="!this.hasBan" @keydown="textareaKeyDown" @keyup="textKeyUp" class="input_text" v-model="message" wrap="hard"></textarea>
</div>
</div>
</template>
Expand All @@ -29,7 +30,10 @@ export default {
fileType: '',
mentionSelectedUids: [],
willsendMessage: '',
filteredMentionRosters: []
filteredMentionRosters: [],
hasBan: false,
expired_time: 0,
banCheckTimer: null
};
},
components: {},
Expand All @@ -39,6 +43,51 @@ export default {
return this.$store.state.im;
}
},
mounted() {
let that = this;
this.hasBan = false;
this.chechBan(this.getSid);
this.$store.getters.im.on('onGroupBaned', (meta) => {
const { groupId, toUids, content } = meta;
if (that.getSid === groupId) {
if (Array.isArray(toUids) && toUids.length && parseInt(content)) {
toUids.forEach((id) => {
if (id === this.im.userManage.getUid()) {
that.hasBan = true;
that.expired_time = Date.now() + parseInt(content) * 60 * 1000;
console.log('SSSS onGroupBaned work here.');
console.log('SSSS onGroupBaned that.expired_time : ' + that.expired_time);
console.log('SSSS onGroupBaned Date.now() : ' + Date.now());
that.startBanCheck();
}
});
}
}
});
this.$store.getters.im.on('onGroupUnbaned', (meta) => {
const { groupId, toUids } = meta;
if (that.getSid === groupId) {
if (Array.isArray(toUids) && toUids.length) {
toUids.forEach((id) => {
if (id === this.im.userManage.getUid()) {
that.stopBanCheck();
}
});
}
}
});
},
destroyed() {
this.stopBanCheck();
},
watch: {
getSid(newSid) {
this.hasBan = false;
this.chechBan(newSid);
}
},
methods: {
textareaKeyDown(evt) {
if (evt.keyCode === 13 && !evt.shiftKey) {
Expand Down Expand Up @@ -236,6 +285,43 @@ export default {
this.message = sarr.join('@') + ' ';
this.textKeyUp();
}
},
chechBan(newSid) {
let that = this;
this.im.groupManage.asyncGroupBannedList({ group_id: newSid }).then((res) => {
if (Array.isArray(res) && res.length) {
res.forEach((item) => {
if (item.user_id === this.im.userManage.getUid() && item.expired_time > Date.now()) {
that.hasBan = true;
that.expired_time = item.expired_time;
console.log('SSSS chechBan work here.');
console.log('SSSS chechBan expired_time :' + item.expired_time);
console.log('SSSS chechBan Date.now() : ' + Date.now());
that.startBanCheck();
}
});
}
});
},
startBanCheck() {
this.banCheckTimer = setInterval(() => {
console.log('SSSS banCheckTimer timer work here.');
console.log('SSSS banCheckTimer expired_time : ' + this.expired_time);
console.log('SSSS banCheckTimer Date.now() : ' + Date.now());
if (this.expired_time > Date.now()) {
// do nothing.
} else {
this.stopBanCheck();
}
}, 5000);
},
stopBanCheck() {
console.log('SSSS banCheckTimer timer stop here.');
clearInterval(this.banCheckTimer);
this.banCheckTimer = null;
this.hasBan = false;
}
//methods finish
}
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/ui/chatting/content/group/memberList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,13 @@ export default {
let hide = true;
let hide_member_info = this.getGroupInfo.hide_member_info;
let app_hide_member_info = false;
const uid = this.im.userManage.getUid();
let appConfig = this.im.sysManage.getAppConfig(this.im.userManage.getAppid());
if (appConfig) {
app_hide_member_info = appConfig.hide_member_info;
}
const uid = this.$store.getters.im.userManage.getUid();
if (app_hide_member_info) {
if (this.isOwner || this.isAdmin || uid === user_id || !hide_member_info) {
if (uid === user_id || !hide_member_info) {
hide = false;
}
} else {
Expand Down Expand Up @@ -114,7 +113,7 @@ export default {
},
displayName(roster) {
if (this.checkHideMemberInfo(roster.user_id)) {
if (this.checkHideMemberInfo(roster.user_id) && !roster.has_nick) {
return this.calucateHideMemberName(roster);
} else {
return roster.display_name;
Expand Down
8 changes: 5 additions & 3 deletions src/renderer/ui/chatting/content/group/renderMsg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,19 @@ export default {
const fromUid = toNumber(this.message.from);
const fromUserObj = umaps[fromUid] || {};
let username = '';
let has_nick = false;
for (let i = 0; i < this.getMemberList.length; i++) {
if (this.getMemberList[i].user_id === fromUid) {
username = this.getMemberList[i].display_name;
has_nick = this.getMemberList[i].has_nick;
break;
}
}
let avatar = this.im.sysManage.getImage({ avatar: fromUserObj.avatar });
if (fromUid === cuid) {
username = '';
avatar = this.im.sysManage.getImage({ avatar: this.getUserProfile.avatar });
} else if (this.checkHideMemberInfo(fromUid)) {
} else if (this.checkHideMemberInfo(fromUid) && !has_nick) {
let original = username + fromUid;
const md5hash = CryptoJS.MD5(original);
let output = md5hash.toString(CryptoJS.enc.Base64);
Expand Down Expand Up @@ -610,13 +612,13 @@ export default {
let hide = true;
let hide_member_info = this.getGroupInfo.hide_member_info;
let app_hide_member_info = false;
const uid = this.im.userManage.getUid();
let appConfig = this.im.sysManage.getAppConfig(this.im.userManage.getAppid());
if (appConfig) {
app_hide_member_info = appConfig.hide_member_info;
}
const uid = this.$store.getters.im.userManage.getUid();
if (app_hide_member_info) {
if (this.isOwner || this.isAdmin || !hide_member_info) {
if (uid === user_id || !hide_member_info) {
hide = false;
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
const sret = applicationlist.map((item) => {
const { status, group_id, applicant_id, expired_time, reason } = item;
const suser = rmap[applicant_id] || {};
const user_name = suser.alias || suser.username || item.inviter_id;
const user_name = suser.nick_name || suser.username || item.inviter_id;
const sgroup = gmap[group_id] || {};
const group_name = sgroup.name || item.group_id;
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default {
const sret = applicationlist.map((item) => {
const { group_id, inviter_id, expired_time, status } = item;
const suser = rmap[inviter_id] || {};
const user_name = suser.alias || suser.username || item.inviter_id;
const user_name = suser.nick_name || suser.username || item.inviter_id;
const sgroup = gmap[group_id] || {};
const group_name = sgroup.name || item.group_id;
return {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/ui/chatting/content/notice/rosterNotice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
const rosterMaps = this.im.rosterManage.getAllRosterDetail();
res.forEach((r) => {
const suser = rosterMaps[r.user_id] || {};
r.user_name = suser.alias || suser.nick_name || suser.username || r.user_id;
r.user_name = suser.nick_name || suser.username || r.user_id;
});
this.notices = res;
});
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/ui/chatting/content/roster/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
computed: {
...mapGetters('content', ['getRosterInfo', 'getSid']),
rosterName() {
let name = this.getRosterInfo.alias || this.getRosterInfo.nick_name || this.getRosterInfo.username;
let name = this.getRosterInfo.nick_name || this.getRosterInfo.username;
if (!name) {
this.$store.dispatch('content/actionUpdateRoster');
}
Expand Down
25 changes: 0 additions & 25 deletions src/renderer/ui/chatting/content/roster/info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
<p class="lr">{{ nickName }}</p>
</div>

<div class="line">
<span class="ll">用户别名</span>
<p @click="setRosterAlias" class="lr">{{ alias }}</p>
</div>

<div @click="chatRemoveHandler" class="logout mt15" v-if="isFriend">删除好友</div>
<div @click="addFriendHandler" class="logout mt15" v-else>添加好友</div>
<div @click="chatClickHandler" class="logout mt15" v-if="isFriend">开始聊天</div>
Expand Down Expand Up @@ -61,9 +56,6 @@ export default {
rosterName() {
return this.userInfo.username;
},
alias() {
return this.userInfo.alias;
},
nickName() {
return this.userInfo.nick_name;
},
Expand All @@ -85,23 +77,6 @@ export default {
this.userInfo = res;
});
},
setRosterAlias() {
const im = this.$store.getters.im;
this.$prompt('请输入别名', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
})
.then(({ value }) => {
if (!value) return;
im.rosterManage.asyncUpdateRosterAlias({ user_id: this.getSid, alias: value }).then(() => {
this.$store.dispatch('content/actionUpdateRoster');
this.$store.dispatch('contact/actionGetConversationList');
this.$store.dispatch('contact/actionLazyGetRosterList');
alert('修改成功');
});
})
.catch(() => {});
},
chatRemoveHandler() {
this.$store.getters.im.rosterManage.asyncDeleteRoster({ user_id: this.getSid }).then(() => {
alert('好友已删除');
Expand Down
Loading

0 comments on commit 82abce6

Please sign in to comment.