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
4c085039
Commit
4c085039
authored
Jan 23, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Android Protocol - Rebuild Image Protocol
parent
5d9dff59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/image/ImageDownPacket.kt
...oid/network/protocol/packet/chat/image/ImageDownPacket.kt
+13
-0
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/image/ImageUpPacket.kt
...droid/network/protocol/packet/chat/image/ImageUpPacket.kt
+13
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/image/ImageDownPacket.kt
View file @
4c085039
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.serialization.protobuf.ProtoBuf
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.network.QQAndroidClient
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgingPacket
internal
object
ImageDownPacket
:
PacketFactory
<
ImageDownPacket
.
ImageDownPacketResponse
>()
{
internal
object
ImageDownPacket
:
PacketFactory
<
ImageDownPacket
.
ImageDownPacketResponse
>()
{
...
@@ -12,6 +16,15 @@ internal object ImageDownPacket : PacketFactory<ImageDownPacket.ImageDownPacketR
...
@@ -12,6 +16,15 @@ internal object ImageDownPacket : PacketFactory<ImageDownPacket.ImageDownPacketR
}
}
operator
fun
invoke
(
client
:
QQAndroidClient
,
req
:
GetImgUrlReq
):
OutgoingPacket
{
return
buildOutgingPacket
(
client
,
this
.
_commandName
,
this
.
_commandName
,
client
.
wLoginSigInfo
.
d2Key
)
{
ProtoBuf
.
dump
(
Cmd0x325Packet
.
serializer
(),
Cmd0x325Packet
.
createByImageRequest
(
req
)
)
}
}
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
ImageDownPacketResponse
{
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
ImageDownPacketResponse
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/image/ImageUpPacket.kt
View file @
4c085039
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image
package
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.io.core.ByteReadPacket
import
kotlinx.serialization.protobuf.ProtoBuf
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.data.Packet
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.network.QQAndroidClient
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.PacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgingPacket
internal
object
ImageUpPacket
:
PacketFactory
<
ImageUpPacket
.
ImageUpPacketResponse
>()
{
internal
object
ImageUpPacket
:
PacketFactory
<
ImageUpPacket
.
ImageUpPacketResponse
>()
{
...
@@ -12,6 +16,15 @@ internal object ImageUpPacket : PacketFactory<ImageUpPacket.ImageUpPacketRespons
...
@@ -12,6 +16,15 @@ internal object ImageUpPacket : PacketFactory<ImageUpPacket.ImageUpPacketRespons
}
}
operator
fun
invoke
(
client
:
QQAndroidClient
,
req
:
UploadImgReq
):
OutgoingPacket
{
return
buildOutgingPacket
(
client
,
this
.
_commandName
,
this
.
_commandName
,
client
.
wLoginSigInfo
.
d2Key
)
{
ProtoBuf
.
dump
(
Cmd0x325Packet
.
serializer
(),
Cmd0x325Packet
.
createByImageRequest
(
req
)
)
}
}
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
ImageUpPacketResponse
{
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
):
ImageUpPacketResponse
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
}
...
@@ -21,5 +34,4 @@ internal object ImageUpPacket : PacketFactory<ImageUpPacket.ImageUpPacketRespons
...
@@ -21,5 +34,4 @@ internal object ImageUpPacket : PacketFactory<ImageUpPacket.ImageUpPacketRespons
object
Success
:
ImageUpPacketResponse
()
object
Success
:
ImageUpPacketResponse
()
}
}
}
}
\ No newline at end of file
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