Skip to content

Feature/split im group #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: release/2.8.102
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
.externalNativeBuild
.cxx
/app/normal/*
/app/src/normal/java/io/agora/education/fetchtoken/
/app/src/normal/java/io/agora/education/fetchtoken/
app/release/app-release.apk
app/release/output-metadata.json
7 changes: 3 additions & 4 deletions AgoraClassSDK/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ android {
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.ClassSDK.versionCode
versionName rootProject.ext.ClassSDK.versionName

consumerProguardFiles "consumer-rules.pro"

Expand All @@ -35,6 +33,7 @@ android {
viewBinding {
enabled = true
}
namespace 'io.agora.agoraclasssdk'
}

dependencies {
Expand All @@ -47,9 +46,9 @@ dependencies {

compileOnly project(path: ':AgoraEduUIKit')
if (readyPublishGithub.toBoolean()) {
compileOnly "io.github.agoraio-community:AgoraEduCore:${rootProject.ext.dependencies.EduCore}"
compileOnly "io.github.agora-apaas:AgoraEduCore:${rootProject.ext.dependencies.EduCore}"
} else {
compileOnly project(path: ':AgoraEduCore')
implementation project(path: ':AgoraEduCore')
}
}

Expand Down
3 changes: 1 addition & 2 deletions AgoraClassSDK/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.agora.agoraclasssdk">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>

Expand Down
5 changes: 2 additions & 3 deletions AgoraCloudScene/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ android {
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.AgoraCloudScene.versionCode
versionName rootProject.ext.AgoraCloudScene.versionName

buildConfigField 'String', 'AgoraCloudScene', String.format("\"%s\"", rootProject.ext.AgoraCloudScene.versionName)
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -47,6 +45,7 @@ android {
res.srcDirs = ['src/main/res']
}
}
namespace 'io.agora.online'
}

dependencies {
Expand All @@ -64,7 +63,7 @@ dependencies {
implementation "androidx.activity:activity-ktx:1.2.2" // for ide hint

if (readyPublishGithub.toBoolean()) {
compileOnly "io.github.agoraio-community:AgoraEduCore:${rootProject.ext.dependencies.EduCore}"
compileOnly "io.github.agora-apaas:AgoraEduCore:${rootProject.ext.dependencies.EduCore}"
} else {
implementation project(path: ':AgoraEduCore')
}
Expand Down
3 changes: 1 addition & 2 deletions AgoraCloudScene/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.agora.online">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down
7 changes: 3 additions & 4 deletions AgoraEduUIKit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ android {
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.EduUIKit.versionCode
versionName rootProject.ext.EduUIKit.versionName

buildConfigField 'String', 'AgoraEduUIKitVersion', String.format("\"%s\"", rootProject.ext.EduUIKit.versionName)
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -45,6 +43,7 @@ android {
res.srcDirs = ['src/main/res']
}
}
namespace 'io.agora.agoraeduuikit'
}

dependencies {
Expand All @@ -62,9 +61,9 @@ dependencies {
implementation "androidx.activity:activity-ktx:1.2.2" // for ide hint

if (readyPublishGithub.toBoolean()) {
compileOnly "io.github.agoraio-community:AgoraEduCore:${rootProject.ext.dependencies.EduCore}"
compileOnly "io.github.agora-apaas:AgoraEduCore:${rootProject.ext.dependencies.EduCore}"
} else {
compileOnly project(path: ':AgoraEduCore')
implementation project(path: ':AgoraEduCore')
}

// for agora chat
Expand Down
3 changes: 1 addition & 2 deletions AgoraEduUIKit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.agora.agoraeduuikit">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class AgoraEduEaseChatWidget : ChatPopupWidget(), InputMsgListener, ChatPagerLis
private var appKey = ""
private var role = EaseConstant.ROLE_STUDENT
private var easeChatId = "" // 环信ID
private var _recvRoomIds:List<*>? = null
private var _sendRoomIds:List<*>? = null
private var _chatGroupUuids:List<*>? = null
private var userUuid = ""
private var mChatRoomId = ""
private var nickName = ""
Expand All @@ -55,6 +58,7 @@ class AgoraEduEaseChatWidget : ChatPopupWidget(), InputMsgListener, ChatPagerLis
private var chatViewPager: ChatViewPager? = null
private var contentLayout: FrameLayout? = null
private var inputView: InputView? = null
private var _chatGroupMap: MutableMap<*, *>? = null

// specified input`s parentView
private var specialInputViewParent: ViewGroup? = null
Expand All @@ -69,6 +73,47 @@ class AgoraEduEaseChatWidget : ChatPopupWidget(), InputMsgListener, ChatPagerLis

var isNeedRoomMutedStatus = true //是否需要判断禁言状态


val sendRoomIds: List<String>
get() {
val list = mutableListOf<String>()
_sendRoomIds?.forEach {
list.add(it.toString())
}
return list
}

val recvRoomIds: List<String>
get() {
val list = mutableListOf<String>()
_recvRoomIds?.forEach {
list.add(it.toString())
}
return list
}

val chatGroupUuids: List<String>
get() {
val list = mutableListOf<String>()
_chatGroupUuids?.forEach {
list.add(it.toString())
}
return list
}

val userRoomIds: List<String>
get() {
val list = mutableListOf<String>()
_chatGroupUuids?.forEach {
val groupUuid = it.toString()
val chatRoomId = _chatGroupMap?.get(groupUuid).toString()
list.add(chatRoomId)
}
return list
}



override fun init(container: ViewGroup) {
super.init(container)
mContext = container.context
Expand Down Expand Up @@ -109,6 +154,10 @@ class AgoraEduEaseChatWidget : ChatPopupWidget(), InputMsgListener, ChatPagerLis
it.setCloseable(false)
it.setAvatarUrl(avatarUrl)
it.setChatRoomId(mChatRoomId)
it.setRecvRoomIds(recvRoomIds)
it.setSendRoomIds(sendRoomIds)
it.setUserRoomIds(userRoomIds)
it.setChatGroupUuids(chatGroupUuids)
it.setNickName(nickName)
it.setRoomUuid(roomUuid)
it.setUserName(easeChatId)
Expand Down Expand Up @@ -184,6 +233,7 @@ class AgoraEduEaseChatWidget : ChatPopupWidget(), InputMsgListener, ChatPagerLis
}
}


private fun parseEaseConfigProperties(): Boolean {
// val properties = eduContext?.widgetContext2()?.getWidgetProperties(WidgetType.IM)
val extraProperties = this.widgetInfo?.roomProperties as? MutableMap<*, *>
Expand All @@ -192,12 +242,17 @@ class AgoraEduEaseChatWidget : ChatPopupWidget(), InputMsgListener, ChatPagerLis
appName = it["appName"] as? String ?: ""
mChatRoomId = it["chatRoomId"] as? String ?: mChatRoomId
appKey = it["appKey"] as? String ?: ""
val chatGroup = it["chatGroup"] as? MutableMap<*, *>
_chatGroupMap = chatGroup?.get("groups") as? MutableMap<*, *>
role = this.widgetInfo?.localUserInfo?.userRole ?: EaseConstant.ROLE_STUDENT
EaseRepository.instance.role = role
}

this.widgetInfo?.localUserProperties?.let {
easeChatId = it[userIdKey].toString()
_sendRoomIds = it[sendRoomIdKey] as? List<*>
_recvRoomIds = it[recvRoomIdKey] as? List<*>
_chatGroupUuids = it[chatGroupUuidsKey] as? List<*>
}
return !TextUtils.isEmpty(easeChatId)
&& !TextUtils.isEmpty(orgName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ object EaseConstant {
const val NORMAL_MSG = 0

const val ROLE = "role"
const val CHAT_GROUP_UUIDS = "chatGroupUuids"
const val ROLE_TEACHER = 1
const val ROLE_STUDENT = 2
const val ROLE_ASSISTANT = 3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.hyphenate.easeim.modules.exception

class ChatError(_code:Int, message: String) : RuntimeException(message) {
val code = _code
}
Loading