update 获取房间名称优化
This commit is contained in:
@@ -30,6 +30,7 @@ object Constant {
|
||||
var groupQrCode = false
|
||||
var enableMediaProject = false
|
||||
var enableSdkShare = false
|
||||
var fullGroupName = false
|
||||
var robotId: String
|
||||
get() = SPUtils.getInstance().getString("robotId", SPUtils.getInstance().getString("LISTEN_CHANNEL_ID", ""))
|
||||
set(value) {
|
||||
|
||||
@@ -113,8 +113,13 @@ object WeworkLoopImpl {
|
||||
if (Constant.autoReply == 0) return true
|
||||
val roomType = WeworkRoomUtil.getRoomType()
|
||||
var titleList = WeworkRoomUtil.getRoomTitle()
|
||||
if (titleList.contains("对方正在输入…")) {
|
||||
titleList = WeworkRoomUtil.getFriendName()
|
||||
if (titleList.count { it.endsWith("…") } > 0) {
|
||||
if (roomType == WeworkMessageBean.ROOM_TYPE_INTERNAL_CONTACT || roomType == WeworkMessageBean.ROOM_TYPE_EXTERNAL_CONTACT) {
|
||||
titleList = WeworkRoomUtil.getFriendName()
|
||||
} else if (Constant.fullGroupName
|
||||
&& (roomType == WeworkMessageBean.ROOM_TYPE_INTERNAL_GROUP || roomType == WeworkMessageBean.ROOM_TYPE_EXTERNAL_GROUP)) {
|
||||
titleList = WeworkRoomUtil.getGroupName()
|
||||
}
|
||||
}
|
||||
if (roomType != WeworkMessageBean.ROOM_TYPE_UNKNOWN && titleList.size > 0) {
|
||||
val title = titleList.joinToString()
|
||||
|
||||
@@ -225,6 +225,20 @@ object WeworkRoomUtil {
|
||||
return titleList
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前群名并返回房间
|
||||
* 解决title为对方正在输入中问题
|
||||
* @return name 单聊对方姓名
|
||||
*/
|
||||
fun getGroupName(): ArrayList<String> {
|
||||
val titleList = arrayListOf<String>()
|
||||
if (intoGroupManager()) {
|
||||
val groupInfo = WeworkGetImpl.getGroupInfoDetail()
|
||||
titleList.add(groupInfo.groupName)
|
||||
}
|
||||
return titleList
|
||||
}
|
||||
|
||||
/**
|
||||
* 群名是否存在
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user