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
659cfa22
Commit
659cfa22
authored
May 01, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve numbers in log
parent
16c44043
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/FriendImpl.kt
...in/kotlin/net/mamoe/mirai/qqandroid/contact/FriendImpl.kt
+2
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/highway/HighwayHelper.kt
...et/mamoe/mirai/qqandroid/network/highway/HighwayHelper.kt
+7
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/FriendImpl.kt
View file @
659cfa22
...
@@ -30,6 +30,7 @@ import net.mamoe.mirai.message.data.OfflineFriendImage
...
@@ -30,6 +30,7 @@ import net.mamoe.mirai.message.data.OfflineFriendImage
import
net.mamoe.mirai.message.data.isContentNotEmpty
import
net.mamoe.mirai.message.data.isContentNotEmpty
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.network.highway.postImage
import
net.mamoe.mirai.qqandroid.network.highway.postImage
import
net.mamoe.mirai.qqandroid.network.highway.sizeToString
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.Cmd0x352
import
net.mamoe.mirai.qqandroid.network.protocol.data.proto.Cmd0x352
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.LongConn
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.LongConn
import
net.mamoe.mirai.qqandroid.utils.MiraiPlatformUtils
import
net.mamoe.mirai.qqandroid.utils.MiraiPlatformUtils
...
@@ -109,7 +110,7 @@ internal class FriendImpl(
...
@@ -109,7 +110,7 @@ internal class FriendImpl(
}
}
is
LongConn
.
OffPicUp
.
Response
.
RequireUpload
->
{
is
LongConn
.
OffPicUp
.
Response
.
RequireUpload
->
{
bot
.
network
.
logger
.
verbose
{
bot
.
network
.
logger
.
verbose
{
"[Http] Uploading friend image, size=${image.inputSize
/ 1024} KiB
"
"[Http] Uploading friend image, size=${image.inputSize
.sizeToString()}
"
}
}
val
time
=
measureTime
{
val
time
=
measureTime
{
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/highway/HighwayHelper.kt
View file @
659cfa22
...
@@ -128,7 +128,7 @@ internal object HighwayHelper {
...
@@ -128,7 +128,7 @@ internal object HighwayHelper {
}
}
)
{
ip
,
port
->
)
{
ip
,
port
->
bot
.
network
.
logger
.
verbose
{
bot
.
network
.
logger
.
verbose
{
"[Highway] Uploading $kind to ${ip}:$port, size=${inputSize
/ 1024} KiB
"
"[Highway] Uploading $kind to ${ip}:$port, size=${inputSize
.sizeToString()}
"
}
}
val
time
=
measureTime
{
val
time
=
measureTime
{
...
@@ -223,4 +223,10 @@ internal suspend inline fun List<Pair<Int, Int>>.retryWithServers(
...
@@ -223,4 +223,10 @@ internal suspend inline fun List<Pair<Int, Int>>.retryWithServers(
}
}
onFail
(
exception
)
onFail
(
exception
)
}
internal
fun
Long
.
sizeToString
():
String
{
return
if
(
this
<
1024
)
{
"$this B"
}
else
((
this
*
100.0
/
1024
).
roundToInt
()
/
100.0
).
toString
()
+
" KiB"
}
}
\ 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