Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
82faf773
Commit
82faf773
authored
Jul 07, 2020
by
mzdluo123
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try fix tim pc
parent
9494472c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
13 deletions
+22
-13
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/conversions.kt
...n/kotlin/net/mamoe/mirai/qqandroid/message/conversions.kt
+13
-4
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/Cmd0x388.kt
...e/mirai/qqandroid/network/protocol/data/proto/Cmd0x388.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt
...work/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt
+1
-5
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/voice/PttStore.kt
.../qqandroid/network/protocol/packet/chat/voice/PttStore.kt
+4
-0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Voice.kt
...c/commonMain/kotlin/net.mamoe.mirai/message/data/Voice.kt
+3
-3
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/conversions.kt
View file @
82faf773
...
...
@@ -33,6 +33,8 @@ private val UNSUPPORTED_MERGED_MESSAGE_PLAIN = PlainText("你的QQ暂不支持
private
val
UNSUPPORTED_POKE_MESSAGE_PLAIN
=
PlainText
(
"[戳一戳]请使用最新版手机QQ体验新功能。"
)
private
val
UNSUPPORTED_FLASH_MESSAGE_PLAIN
=
PlainText
(
"[闪照]请使用新版手机QQ查看闪照。"
)
@OptIn
(
ExperimentalStdlibApi
::
class
)
@Suppress
(
"INVISIBLE_MEMBER"
,
"INVISIBLE_REFERENCE"
)
internal
fun
MessageChain
.
toRichTextElems
(
forGroup
:
Boolean
,
withGeneralFlags
:
Boolean
):
MutableList
<
ImMsgBody
.
Elem
>
{
val
elements
=
ArrayList
<
ImMsgBody
.
Elem
>(
this
.
size
)
...
...
@@ -156,7 +158,13 @@ internal fun MessageChain.toRichTextElems(forGroup: Boolean, withGeneralFlags: B
is
VipFace
->
{
transformOneMessage
(
PlainText
(
it
.
contentToString
()))
}
is
PttMessage
,
is
PttMessage
->
{
elements
.
add
(
ImMsgBody
.
Elem
(
extraInfo
=
ImMsgBody
.
ExtraInfo
(
flags
=
16
,
groupMask
=
1
)
)
)
}
is
ForwardMessage
,
is
MessageSource
,
// mirai metadata only
is
RichMessage
// already transformed above
...
...
@@ -218,8 +226,8 @@ internal fun MsgComm.Msg.toMessageChain(
val
ptt
=
this
.
msgBody
.
richText
.
ptt
val
pptMsg
=
ptt
?.
run
{
when
(
fileType
)
{
4
->
Voice
(
String
(
fileName
),
fileMd5
,
fileSize
.
toLong
(),
fileKey
,
String
(
downPara
))
when
(
fileType
)
{
4
->
Voice
(
String
(
fileName
),
fileMd5
,
fileSize
.
toLong
(),
time
,
String
(
downPara
))
else
->
null
}
}
...
...
@@ -431,7 +439,8 @@ internal fun List<ImMsgBody.Elem>.joinToMessageChain(groupIdOrZero: Long, bot: B
.
orEmpty
(),
proto
.
pokeType
,
proto
.
vaspokeId
))
)
)
}
3
->
{
val
proto
=
element
.
commonElem
.
pbElem
.
loadAs
(
HummerCommelem
.
MsgElemInfoServtype3
.
serializer
())
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/Cmd0x388.kt
View file @
82faf773
...
...
@@ -273,7 +273,7 @@ internal class TryUpPttReq(
internal
class
TryUpPttRsp
(
@ProtoId
(
1
)
@JvmField
val
fileId
:
Long
=
0L
,
@ProtoId
(
2
)
@JvmField
val
result
:
Int
=
0
,
@ProtoId
(
3
)
@JvmField
val
failMsg
:
ByteArray
=
EMPTY_BYTE_ARRAY
,
@ProtoId
(
3
)
@JvmField
val
failMsg
:
ByteArray
?
=
null
,
@ProtoId
(
4
)
@JvmField
val
boolFileExit
:
Boolean
=
false
,
@ProtoId
(
5
)
@JvmField
val
uint32UpIp
:
List
<
Int
>?
=
null
,
@ProtoId
(
6
)
@JvmField
val
uint32UpPort
:
List
<
Int
>?
=
null
,
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt
View file @
82faf773
...
...
@@ -144,12 +144,8 @@ internal object MessageSvcPbSendMsg : OutgoingPacketFactory<MessageSvcPbSendMsg.
fileMd5
=
md5
,
boolValid
=
true
,
fileSize
=
fileSize
.
toInt
(),
groupFileKey
=
fileKey
,
fileType
=
4
,
// 不知道能不能解决tim无法收听的问题
reserve
=
"16 36 20 38 36 65 41 31 04 37 61 39 35 37 37 61 33 62 37 30 33 66 65 33 31 20 20 20 20 20 20 35 30 55 49 30 E3 3F 8F 9F FB CA 1D 79 60 6C F4 74 F2 35 35 34 39 33 30 45 33 33 46 38 46 39 46 46 42 43 41 31 44 37 39 36 30 36 43 46 34 37 34 46 32 2E 61 6D 72 41"
.
hexToBytes
(),
pbReserve
=
"08 00"
.
hexToBytes
(),
time
=
2
time
=
voiceLength
)
}
)
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/voice/PttStore.kt
View file @
82faf773
...
...
@@ -11,6 +11,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.getRandomString
import
net.mamoe.mirai.qqandroid.utils._miraiContentToString
import
net.mamoe.mirai.qqandroid.utils.encodeToString
import
net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import
net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
import
net.mamoe.mirai.qqandroid.utils.toUHexString
...
...
@@ -77,6 +78,9 @@ internal class PttStore {
val
resp0
=
readProtoBuf
(
Cmd0x388
.
RspBody
.
serializer
())
resp0
.
msgTryupPttRsp
?:
error
(
"cannot find `msgTryupPttRsp` from `Cmd0x388.RspBody`"
)
val
resp
=
resp0
.
msgTryupPttRsp
.
first
()
if
(
resp
.
failMsg
!=
null
)
{
throw
IllegalStateException
(
resp
.
failMsg
.
encodeToString
())
}
return
Response
.
RequireUpload
(
fileId
=
resp
.
fileid
,
uKey
=
resp
.
upUkey
,
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Voice.kt
View file @
82faf773
...
...
@@ -16,7 +16,7 @@ abstract class PttMessage : MessageContent {
abstract
val
fileName
:
String
abstract
val
md5
:
ByteArray
abstract
val
fileSize
:
Long
abstract
val
fileKey
:
ByteArray
abstract
val
voiceLength
:
Int
}
...
...
@@ -29,7 +29,7 @@ class Voice(
override
val
fileName
:
String
,
override
val
md5
:
ByteArray
,
override
val
fileSize
:
Long
,
override
val
fileKey
:
ByteArray
,
override
val
voiceLength
:
Int
,
private
val
_url
:
String
)
:
PttMessage
()
{
...
...
@@ -44,7 +44,7 @@ class Voice(
private
var
_stringValue
:
String
?
=
null
get
()
=
field
?:
kotlin
.
run
{
field
=
"[mirai:voice:$fileName]"
field
=
"[mirai:voice:$fileName
,url:$url
]"
field
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment