mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
update kritor
This commit is contained in:
parent
926c4659f6
commit
36a09ca088
@ -1 +1 @@
|
|||||||
Subproject commit d94600bc7adef49c6dcd5a1973578d4a101c9b38
|
Subproject commit a7dfcf9aa9692f78f387919034f76e0130f6c12e
|
@ -24,12 +24,12 @@ internal object GlobalEventTransmitter : QQInterfaces() {
|
|||||||
MutableSharedFlow<NoticeEvent>()
|
MutableSharedFlow<NoticeEvent>()
|
||||||
}
|
}
|
||||||
private val requestEventFlow by lazy {
|
private val requestEventFlow by lazy {
|
||||||
MutableSharedFlow<RequestsEvent>()
|
MutableSharedFlow<RequestEvent>()
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun pushNotice(noticeEvent: NoticeEvent) = noticeEventFlow.emit(noticeEvent)
|
private suspend fun pushNotice(noticeEvent: NoticeEvent) = noticeEventFlow.emit(noticeEvent)
|
||||||
|
|
||||||
private suspend fun pushRequest(requestEvent: RequestsEvent) = requestEventFlow.emit(requestEvent)
|
private suspend fun pushRequest(requestEvent: RequestEvent) = requestEventFlow.emit(requestEvent)
|
||||||
|
|
||||||
private suspend fun transMessageEvent(record: MsgRecord, message: PushMessageBody) =
|
private suspend fun transMessageEvent(record: MsgRecord, message: PushMessageBody) =
|
||||||
MessageEventFlow.emit(record to message)
|
MessageEventFlow.emit(record to message)
|
||||||
@ -484,13 +484,13 @@ internal object GlobalEventTransmitter : QQInterfaces() {
|
|||||||
*/
|
*/
|
||||||
object RequestTransmitter {
|
object RequestTransmitter {
|
||||||
suspend fun transFriendApp(time: Long, operator: Long, tipText: String, flag: String): Boolean {
|
suspend fun transFriendApp(time: Long, operator: Long, tipText: String, flag: String): Boolean {
|
||||||
pushRequest(RequestsEvent.newBuilder().apply {
|
pushRequest(RequestEvent.newBuilder().apply {
|
||||||
this.type = RequestsEvent.RequestType.FRIEND_APPLY
|
this.type = RequestEvent.RequestType.FRIEND_APPLY
|
||||||
this.time = time.toInt()
|
this.time = time.toInt()
|
||||||
|
this.requestId = flag
|
||||||
this.friendApply = FriendApplyRequest.newBuilder().apply {
|
this.friendApply = FriendApplyRequest.newBuilder().apply {
|
||||||
this.applierUin = operator
|
this.applierUin = operator
|
||||||
this.message = tipText
|
this.message = tipText
|
||||||
this.flag = flag
|
|
||||||
}.build()
|
}.build()
|
||||||
}.build())
|
}.build())
|
||||||
return true
|
return true
|
||||||
@ -504,15 +504,15 @@ internal object GlobalEventTransmitter : QQInterfaces() {
|
|||||||
groupCode: Long,
|
groupCode: Long,
|
||||||
flag: String
|
flag: String
|
||||||
): Boolean {
|
): Boolean {
|
||||||
pushRequest(RequestsEvent.newBuilder().apply {
|
pushRequest(RequestEvent.newBuilder().apply {
|
||||||
this.type = RequestsEvent.RequestType.GROUP_APPLY
|
this.type = RequestEvent.RequestType.GROUP_APPLY
|
||||||
this.time = time.toInt()
|
this.time = time.toInt()
|
||||||
|
this.requestId = flag
|
||||||
this.groupApply = GroupApplyRequest.newBuilder().apply {
|
this.groupApply = GroupApplyRequest.newBuilder().apply {
|
||||||
this.applierUid = applierUid
|
this.applierUid = applierUid
|
||||||
this.applierUin = applierUin
|
this.applierUin = applierUin
|
||||||
this.groupId = groupCode
|
this.groupId = groupCode
|
||||||
this.reason = reason
|
this.reason = reason
|
||||||
this.flag = flag
|
|
||||||
}.build()
|
}.build()
|
||||||
}.build())
|
}.build())
|
||||||
return true
|
return true
|
||||||
@ -535,7 +535,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend inline fun onRequestEvent(collector: FlowCollector<RequestsEvent>) {
|
suspend inline fun onRequestEvent(collector: FlowCollector<RequestEvent>) {
|
||||||
requestEventFlow.collect {
|
requestEventFlow.collect {
|
||||||
GlobalScope.launch {
|
GlobalScope.launch {
|
||||||
collector.emit(it)
|
collector.emit(it)
|
||||||
|
@ -663,14 +663,14 @@ object NtMsgConvertor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MusicPlatform.NetEase -> {
|
MusicPlatform.NETEASE -> {
|
||||||
val id = sourceMusic.music.id
|
val id = sourceMusic.music.id
|
||||||
if (!MusicHelper.tryShare163MusicById(contact, msgId, id)) {
|
if (!MusicHelper.tryShare163MusicById(contact, msgId, id)) {
|
||||||
LogCenter.log("无法发送网易云音乐分享", Level.ERROR)
|
LogCenter.log("无法发送网易云音乐分享", Level.ERROR)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MusicPlatform.Custom -> {
|
MusicPlatform.CUSTOM -> {
|
||||||
val data = sourceMusic.music.custom
|
val data = sourceMusic.music.custom
|
||||||
ArkMsgHelper.tryShareMusic(
|
ArkMsgHelper.tryShareMusic(
|
||||||
contact,
|
contact,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user