Skip to content

armgit / andee

Public Imported from GitHub
0

Andee lives on your phone or Mac and uses any app like you do—no integrations, no root, any model; memory and passwords never leave your device | Andee 住进你的手机或 Mac,像你一样操作任何 App——无需集成、无需 Root、支持任意模型,记忆和密码绝不离开设备。

feat: a WeChat icon beside GitHub and Discord opens Andee's QR code, on both bodies

booboosui2202ac3808ef
diff --git a/app/src/main/java/net/kuafuai/andee/BodyCoreService.kt b/app/src/main/java/net/kuafuai/andee/BodyCoreService.kt
index 4805076..9561780 100644
--- a/app/src/main/java/net/kuafuai/andee/BodyCoreService.kt
+++ b/app/src/main/java/net/kuafuai/andee/BodyCoreService.kt
@@ -342,6 +342,10 @@ class BodyCoreService : Service() {
dispatcher.compactForUser()
}
+ override fun onWeChatClick() {
+ net.kuafuai.andee.ui.WeChatQrUi(this@BodyCoreService).show()
+ }
+
override fun onNotebookClick() {
net.kuafuai.andee.ui.NotebookUi(this@BodyCoreService) {}.show()
}
diff --git a/app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt b/app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt
index 4c9a5a4..d24950d 100644
--- a/app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt
+++ b/app/src/main/java/net/kuafuai/andee/ui/FloatingWindowUi.kt
@@ -173,6 +173,9 @@ class FloatingWindowUi(
*/
fun onOpenCommunityLink(url: String) {}
+ /** The WeChat glyph beside them: Andee's QR code ([WeChatQrUi]). */
+ fun onWeChatClick() {}
+
/** The 小本本 key — what it remembers. See [NotebookUi]. */
fun onNotebookClick() {}
@@ -336,7 +339,10 @@ class FloatingWindowUi(
* sits after; the tap hands the URL out through
* [Listeners.onOpenCommunityLink], which is the host's trip to make.
*/
- private fun communityLink(res: Int, url: String, label: String): View {
+ private fun communityLink(res: Int, url: String, label: String): View =
+ communityGlyph(res, label) { listeners.onOpenCommunityLink(url) }
+
+ private fun communityGlyph(res: Int, label: String, onClick: () -> Unit): View {
val icon = ImageView(context).apply {
setImageResource(res)
setColorFilter(Color.parseColor(Glass.PHOTO_INK))
@@ -348,7 +354,7 @@ class FloatingWindowUi(
setPadding(dp(7), dp(4), dp(7), dp(4))
isClickable = true
Glass.pressable(this)
- setOnClickListener { listeners.onOpenCommunityLink(url) }
+ setOnClickListener { onClick() }
addView(icon, LinearLayout.LayoutParams(dp(16), dp(16)))
}
}
@@ -2532,6 +2538,8 @@ class FloatingWindowUi(
communityRow.addView(tipsLine)
communityRow.addView(communityLink(R.drawable.ic_github, GITHUB_URL, "GitHub"))
communityRow.addView(communityLink(R.drawable.ic_discord, DISCORD_URL, "Discord"))
+ // WeChat is not a link: it opens Andee's QR code, to add it as a friend.
+ communityRow.addView(communityGlyph(R.drawable.ic_wechat, "WeChat") { listeners.onWeChatClick() })
// The input pill, always there on the full card like the Mac's composer. It is not a field: an overlay
// cannot raise the keyboard on this ROM, so a tap opens the real one ([TextInputActivity]) in its place.
val inputRow = LinearLayout(context).apply {
diff --git a/app/src/main/java/net/kuafuai/andee/ui/WeChatQrUi.kt b/app/src/main/java/net/kuafuai/andee/ui/WeChatQrUi.kt
new file mode 100644
index 0000000..e3b3716
--- /dev/null
+++ b/app/src/main/java/net/kuafuai/andee/ui/WeChatQrUi.kt
@@ -0,0 +1,152 @@
+package net.kuafuai.andee.ui
+
+import android.annotation.SuppressLint
+import android.content.ContentValues
+import android.content.Context
+import android.graphics.BitmapFactory
+import android.graphics.Color
+import android.graphics.PixelFormat
+import android.provider.MediaStore
+import android.view.Gravity
+import android.view.View
+import android.view.WindowManager
+import android.widget.ImageView
+import android.widget.LinearLayout
+import android.widget.TextView
+import net.kuafuai.andee.R
+import net.kuafuai.andee.i18n.AppLocale
+
+/**
+ * The WeChat icon at the foot of the card opens this: Andee's WeChat QR code, a line saying to scan it with
+ * WeChat to add Andee as a friend, and 保存到相册 — the code is no use on the screen that is showing it, so the
+ * way to scan it from this same phone is WeChat's "scan from album".
+ *
+ * Saved through [MediaStore] into Pictures/Andee, which needs no storage permission on API 29+ (this app's
+ * minimum is 30). Same window shape as [NotebookUi]: hidden from accessibility, counted by [OwnCard].
+ */
+class WeChatQrUi(private val context: Context) {
+
+ private val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
+ private var root: View? = null
+
+ fun show() {
+ if (root != null) return
+ val p = WindowManager.LayoutParams(
+ WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT,
+ WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, 0, PixelFormat.TRANSLUCENT,
+ )
+ val frosted = Glass.frost(context, wm, p)
+ val v = build(frosted)
+ runCatching {
+ v.hideFromAccessibility()
+ wm.addView(v, p)
+ root = v
+ OwnCard.shown()
+ Glass.enter(v)
+ }
+ }
+
+ fun hide() {
+ val v = root ?: return
+ root = null
+ Glass.exit(v) {
+ runCatching { wm.removeView(v) }
+ OwnCard.hidden()
+ }
+ }
+
+ @SuppressLint("SetTextI18n")
+ private fun build(frosted: Boolean): View {
+ val lctx = AppLocale.wrap(context)
+ val width = minOf(dp(360), (wm.currentWindowMetrics.bounds.width() * 0.86f).toInt())
+ val card = LinearLayout(context).apply {
+ orientation = LinearLayout.VERTICAL
+ gravity = Gravity.CENTER_HORIZONTAL
+ background = Glass.card(context, dp(28), frosted)
+ setPadding(dp(22), dp(18), dp(22), dp(22))
+ isClickable = true // a tap on the card itself must not reach the scrim behind it
+ }
+ val top = LinearLayout(context).apply { orientation = LinearLayout.HORIZONTAL; gravity = Gravity.CENTER_VERTICAL }
+ top.addView(TextView(context).apply {
+ text = lctx.getString(R.string.wechat_title)
+ textSize = Glass.Type.TITLE
+ setTextColor(Color.parseColor(Glass.TITLE))
+ }, LinearLayout.LayoutParams(0, WRAP, 1f))
+ top.addView(TextView(context).apply {
+ text = "✕"
+ textSize = Glass.Type.CAPTION
+ setTextColor(Color.parseColor(Glass.SECONDARY))
+ gravity = Gravity.CENTER
+ background = Glass.panel(context, dp(16))
+ isClickable = true
+ Glass.pressable(this)
+ setOnClickListener { hide() }
+ }, LinearLayout.LayoutParams(dp(32), dp(32)))
+ card.addView(top, LinearLayout.LayoutParams(MATCH, WRAP))
+
+ // On white whatever the theme: a QR code needs its quiet zone, and the image already carries its own.
+ card.addView(ImageView(context).apply {
+ setImageResource(R.drawable.wechat_qr)
+ adjustViewBounds = true
+ scaleType = ImageView.ScaleType.FIT_CENTER
+ background = android.graphics.drawable.GradientDrawable().apply { setColor(Color.WHITE); cornerRadius = dp(16).toFloat() }
+ clipToOutline = true
+ }, LinearLayout.LayoutParams(MATCH, WRAP).apply { topMargin = dp(14) })
+
+ card.addView(TextView(context).apply {
+ text = lctx.getString(R.string.wechat_hint)
+ textSize = Glass.Type.BODY
+ setTextColor(Color.parseColor(Glass.LABEL))
+ gravity = Gravity.CENTER
+ }, LinearLayout.LayoutParams(MATCH, WRAP).apply { topMargin = dp(14) })
+
+ val save = TextView(context).apply {
+ text = lctx.getString(R.string.wechat_save)
+ textSize = Glass.Type.BODY
+ setTextColor(Color.parseColor(Glass.ON_TINT))
+ gravity = Gravity.CENTER
+ background = Glass.tinted(context, dp(24))
+ setPadding(dp(26), dp(13), dp(26), dp(13))
+ isClickable = true
+ Glass.pressable(this)
+ }
+ save.setOnClickListener {
+ val ok = saveToGallery()
+ save.text = lctx.getString(if (ok) R.string.wechat_saved else R.string.wechat_save_failed)
+ if (ok) save.isClickable = false
+ }
+ card.addView(save, LinearLayout.LayoutParams(MATCH, WRAP).apply { topMargin = dp(16) })
+
+ // A dimmed full-screen scrim: tapping outside the card closes it.
+ return android.widget.FrameLayout(context).apply {
+ setBackgroundColor(Color.parseColor("#66000000"))
+ setOnClickListener { hide() }
+ addView(card, android.widget.FrameLayout.LayoutParams(width, WRAP, Gravity.CENTER))
+ }
+ }
+
+ /** Into Pictures/Andee through MediaStore — no permission needed. True when the file was written. */
+ private fun saveToGallery(): Boolean = runCatching {
+ val bmp = BitmapFactory.decodeResource(context.resources, R.drawable.wechat_qr) ?: return false
+ val values = ContentValues().apply {
+ put(MediaStore.Images.Media.DISPLAY_NAME, "andee-wechat-${System.currentTimeMillis()}.png")
+ put(MediaStore.Images.Media.MIME_TYPE, "image/png")
+ put(MediaStore.Images.Media.RELATIVE_PATH, "Pictures/Andee")
+ put(MediaStore.Images.Media.IS_PENDING, 1)
+ }
+ val resolver = context.contentResolver
+ val uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values) ?: return false
+ val written = resolver.openOutputStream(uri)?.use { bmp.compress(android.graphics.Bitmap.CompressFormat.PNG, 100, it) } == true
+ if (!written) { resolver.delete(uri, null, null); return false }
+ values.clear(); values.put(MediaStore.Images.Media.IS_PENDING, 0)
+ resolver.update(uri, values, null, null)
+ true
+ }.getOrDefault(false)
+
+ private fun dp(v: Int): Int = (v * context.resources.displayMetrics.density).toInt()
+
+ private companion object {
+ const val MATCH = LinearLayout.LayoutParams.MATCH_PARENT
+ const val WRAP = LinearLayout.LayoutParams.WRAP_CONTENT
+ }
+}
diff --git a/app/src/main/res/drawable-nodpi/wechat_qr.png b/app/src/main/res/drawable-nodpi/wechat_qr.png
new file mode 100644
index 0000000..66d6ee2
Binary files /dev/null and b/app/src/main/res/drawable-nodpi/wechat_qr.png differ
diff --git a/app/src/main/res/drawable/ic_wechat.xml b/app/src/main/res/drawable/ic_wechat.xml
new file mode 100644
index 0000000..deb4e06
--- /dev/null
+++ b/app/src/main/res/drawable/ic_wechat.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a0.59 0.59 0 0 1 0.213 0.665l-0.39 1.48c-0.019 0.07-0.048 0.141-0.048 0.213 0 0.163 0.13 0.295 0.29 0.295a0.326 0.326 0 0 0 0.167-0.054l1.903-1.114a0.864 0.864 0 0 1 0.717-0.098 10.16 10.16 0 0 0 2.837 0.403c0.276 0 0.543-0.027 0.811-0.05-0.857-2.578 0.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-0.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c0.642 0 1.162 0.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-0.651 0.52-1.18 1.162-1.18zm5.813 0c0.642 0 1.162 0.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-0.651 0.52-1.18 1.162-1.18zm5.34 2.867c-1.797-0.052-3.746 0.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22 0.942 2.453 3.666 4.229 6.884 4.229 0.826 0 1.622-0.12 2.361-0.336a0.722 0.722 0 0 1 0.598 0.082l1.584 0.926a0.272 0.272 0 0 0 0.14 0.047c0.134 0 0.24-0.111 0.24-0.247 0-0.06-0.023-0.12-0.038-0.177l-0.327-1.233a0.582 0.582 0 0 1-0.023-0.156 0.49 0.49 0 0 1 0.201-0.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-0.135-0.01-0.27-0.027-0.407-0.03zm-2.53 3.274c0.535 0 0.969 0.44 0.969 0.982a0.976 0.976 0 0 1-0.969 0.983 0.976 0.976 0 0 1-0.969-0.983c0-0.542 0.434-0.982 0.97-0.982zm4.844 0c0.535 0 0.969 0.44 0.969 0.982a0.976 0.976 0 0 1-0.969 0.983 0.976 0.976 0 0 1-0.969-0.983c0-0.542 0.434-0.982 0.969-0.982z"/>
+</vector>
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index 2cac715..6a2ab98 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -475,6 +475,11 @@
<string name="notebook_dump_next">" · next "</string>
<string name="notebook_dump_last_error">" last error: "</string>
+ <string name="wechat_title">Add Andee on WeChat</string>
+ <string name="wechat_hint">Scan with WeChat to add Andee as a friend</string>
+ <string name="wechat_save">Save to Photos</string>
+ <string name="wechat_saved">Saved. In WeChat\'s Scan, pick it from your photos</string>
+ <string name="wechat_save_failed">Could not save it; take a screenshot instead</string>
<string name="notebook_title">What it remembers</string>
<string name="notebook_copy_all">Copy all</string>
<string name="notebook_copied">Copied</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 09a3977..35d29f3 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -499,6 +499,11 @@
words rather than the raw enum values ("没接住" is not a word a person
uses; 踩过的坑 is).
-->
+ <string name="wechat_title">加 Andee 为微信好友</string>
+ <string name="wechat_hint">用微信扫码,添加 Andee 为好友</string>
+ <string name="wechat_save">保存到相册</string>
+ <string name="wechat_saved">已保存到相册,在微信「扫一扫」里选图片即可</string>
+ <string name="wechat_save_failed">没存上,可以截屏保存</string>
<string name="notebook_title">它记得的事</string>
<string name="notebook_copy_all">复制全部</string>
<string name="notebook_copied">已复制</string>
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt
index a078359..7ff579f 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/ChatScreen.kt
@@ -43,6 +43,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.toComposeImageBitmap
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.KeyEventType
@@ -129,6 +130,7 @@ fun ChatScreen(onOpenArtifacts: () -> Unit, onOpenTopic: (Long) -> Unit = {}, on
var pending by remember { mutableStateOf(Assistant.pending) }
val attached = remember { androidx.compose.runtime.mutableStateListOf<Attachment>().apply { addAll(ChatPreview.attachments) } }
var dropping by remember { mutableStateOf(false) }
+ var wechat by remember { mutableStateOf(System.getProperty("andee.shot.wechat") == "1") }
var muted by remember { mutableStateOf(Assistant.muted) }
var recording by remember { mutableStateOf(Meeting.isActive()) }
// A folded stretch is one card standing where its messages stood — the phone's rule, so the
@@ -329,8 +331,11 @@ fun ChatScreen(onOpenArtifacts: () -> Unit, onOpenTopic: (Long) -> Unit = {}, on
)
Box(Modifier.clickable { openLink(GITHUB_URL) }.padding(horizontal = 5.dp, vertical = 2.dp)) { Icon(AndeeIcon.GITHUB, Palette.photoInk, 13.dp) }
Box(Modifier.clickable { openLink(DISCORD_URL) }.padding(horizontal = 5.dp, vertical = 2.dp)) { Icon(AndeeIcon.DISCORD, Palette.photoInk, 13.dp) }
+ // WeChat is not a link: it shows Andee's QR code, to add it as a friend.
+ Box(Modifier.clickable { wechat = true }.padding(horizontal = 5.dp, vertical = 2.dp)) { Icon(AndeeIcon.WECHAT, Palette.photoInk, 13.dp) }
}
}
+ if (wechat) WeChatQr(onDone = { wechat = false })
if (dropping) {
Box(
Modifier.fillMaxSize().padding(10.dp)
@@ -614,3 +619,38 @@ private fun Modifier.fadeTop(height: androidx.compose.ui.unit.Dp): Modifier = th
)
}
+
+/** Andee's WeChat QR code over the conversation; a click outside it or on ✕ closes it. */
+@Composable
+private fun WeChatQr(onDone: () -> Unit) {
+ val zh = Strings.lang() == "zh"
+ val img: androidx.compose.ui.graphics.ImageBitmap? = remember { wechatQr() }
+ Box(
+ Modifier.fillMaxSize().background(Color.Black.copy(alpha = 0.35f)).clickable(onClick = onDone),
+ contentAlignment = Alignment.Center,
+ ) {
+ Column(
+ Modifier.widthIn(max = 340.dp).background(Palette.cardSolid, RoundedCornerShape(22.dp)).border(1.dp, Palette.hairline, RoundedCornerShape(22.dp)).clickable(enabled = false) {}.padding(20.dp),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ ) {
+ Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
+ Text(if (zh) "加 Andee 为微信好友" else "Add Andee on WeChat", color = Palette.title, fontSize = 16.sp, modifier = Modifier.weight(1f))
+ Box(Modifier.clickable(onClick = onDone).padding(6.dp)) { Icon(AndeeIcon.CLOSE, Palette.secondary, 14.dp) }
+ }
+ Spacer(Modifier.height(12.dp))
+ if (img != null) {
+ androidx.compose.foundation.Image(img, contentDescription = "WeChat QR",
+ modifier = Modifier.fillMaxWidth().background(Color.White, RoundedCornerShape(14.dp)).padding(6.dp))
+ }
+ Spacer(Modifier.height(12.dp))
+ Text(if (zh) "用微信扫码,添加 Andee 为好友" else "Scan with WeChat to add Andee as a friend", color = Palette.label, fontSize = 13.sp)
+ }
+ }
+}
+
+private object WeChatQrImage
+
+private fun wechatQr(): androidx.compose.ui.graphics.ImageBitmap? = runCatching {
+ val bytes = WeChatQrImage::class.java.getResourceAsStream("/wechat_qr.png")!!.use { it.readBytes() }
+ org.jetbrains.skia.Image.makeFromEncoded(bytes).toComposeImageBitmap()
+}.getOrNull()
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Icons.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Icons.kt
index 245abc3..229ecc0 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Icons.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/Icons.kt
@@ -54,6 +54,9 @@ enum class AndeeIcon(val d: String, val filled: Boolean = false) {
CHECK("M20 6 9 17l-5-5"),
/** GitHub mark (octocat), filled. */
GITHUB("M12,0C5.37,0 0,5.37 0,12c0,5.31 3.435,9.795 8.205,11.385c0.6,0.105 0.825,-0.255 0.825,-0.57c0,-0.285 -0.015,-1.23 -0.015,-2.235c-3.015,0.555 -3.795,-0.735 -4.035,-1.41c-0.135,-0.345 -0.72,-1.41 -1.23,-1.695c-0.42,-0.225 -1.02,-0.78 -0.015,-0.795c0.945,-0.015 1.62,0.87 1.845,1.23c1.08,1.815 2.805,1.305 3.495,0.99c0.105,-0.78 0.42,-1.305 0.765,-1.605c-2.67,-0.3 -5.46,-1.335 -5.46,-5.925c0,-1.305 0.465,-2.385 1.23,-3.225c-0.12,-0.3 -0.54,-1.53 0.12,-3.18c0,0 1.005,-0.315 3.3,1.23c0.96,-0.27 1.98,-0.405 3,-0.405s2.04,0.135 3,0.405c2.295,-1.56 3.3,-1.23 3.3,-1.23c0.66,1.65 0.24,2.88 0.12,3.18c0.765,0.84 1.23,1.905 1.23,3.225c0,4.605 -2.805,5.625 -5.475,5.925c0.435,0.375 0.81,1.095 0.81,2.22c0,1.605 -0.015,2.895 -0.015,3.3c0,0.315 0.225,0.69 0.825,0.57C20.565,21.795 24,17.31 24,12c0,-6.63 -5.37,-12 -12,-12z", filled = true),
+ /** WeChat mark, filled (Simple Icons, CC0). */
+ WECHAT("M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a0.59 0.59 0 0 1 0.213 0.665l-0.39 1.48c-0.019 0.07-0.048 0.141-0.048 0.213 0 0.163 0.13 0.295 0.29 0.295a0.326 0.326 0 0 0 0.167-0.054l1.903-1.114a0.864 0.864 0 0 1 0.717-0.098 10.16 10.16 0 0 0 2.837 0.403c0.276 0 0.543-0.027 0.811-0.05-0.857-2.578 0.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-0.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c0.642 0 1.162 0.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-0.651 0.52-1.18 1.162-1.18zm5.813 0c0.642 0 1.162 0.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-0.651 0.52-1.18 1.162-1.18zm5.34 2.867c-1.797-0.052-3.746 0.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22 0.942 2.453 3.666 4.229 6.884 4.229 0.826 0 1.622-0.12 2.361-0.336a0.722 0.722 0 0 1 0.598 0.082l1.584 0.926a0.272 0.272 0 0 0 0.14 0.047c0.134 0 0.24-0.111 0.24-0.247 0-0.06-0.023-0.12-0.038-0.177l-0.327-1.233a0.582 0.582 0 0 1-0.023-0.156 0.49 0.49 0 0 1 0.201-0.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-0.135-0.01-0.27-0.027-0.407-0.03zm-2.53 3.274c0.535 0 0.969 0.44 0.969 0.982a0.976 0.976 0 0 1-0.969 0.983 0.976 0.976 0 0 1-0.969-0.983c0-0.542 0.434-0.982 0.97-0.982zm4.844 0c0.535 0 0.969 0.44 0.969 0.982a0.976 0.976 0 0 1-0.969 0.983 0.976 0.976 0 0 1-0.969-0.983c0-0.542 0.434-0.982 0.969-0.982z", filled = true),
+
/** Discord mark, filled. */
DISCORD("M20.317,4.37a19.791,19.791 0,0 0,-4.885 -1.515,0.074 0.074,0 0,0 -0.079,0.037c-0.21,0.375 -0.444,0.864 -0.608,1.25a18.27,18.27 0,0 0,-5.487 0,12.64 12.64,0 0,0 -0.617,-1.25 0.077,0.077 0,0 0,-0.079 -0.037A19.736,19.736 0,0 0,3.677 4.37a0.07,0.07 0,0 0,-0.032 0.027C0.533,9.046 -0.32,13.58 0.099,18.057a0.082,0.082 0,0 0,0.031 0.057,19.9 19.9,0 0,0 5.993,3.03 0.078,0.078 0,0 0,0.084 -0.028c0.462,-0.63 0.874,-1.295 1.226,-1.994a0.076,0.076 0,0 0,-0.041 -0.106,13.107 13.107,0 0,1 -1.872,-0.892 0.077,0.077 0,0 1,-0.008 -0.128c0.126,-0.094 0.252,-0.192 0.372,-0.291a0.074,0.074 0,0 1,0.077 -0.01c3.928,1.793 8.18,1.793 12.062,0a0.074,0.074 0,0 1,0.078 0.01c0.12,0.098 0.246,0.198 0.373,0.292a0.077,0.077 0,0 1,-0.006 0.127,12.3 12.3,0 0,1 -1.873,0.892 0.077,0.077 0,0 0,-0.041 0.107c0.36,0.698 0.772,1.362 1.225,1.993a0.076,0.076 0,0 0,0.084 0.028,19.84 19.84,0 0,0 6.002,-3.03 0.077,0.077 0,0 0,0.032 -0.054c0.5,-5.177 -0.838,-9.674 -3.549,-13.66a0.061,0.061 0,0 0,-0.031 -0.03zM8.02,15.33c-1.183,0 -2.157,-1.085 -2.157,-2.419 0,-1.333 0.956,-2.419 2.157,-2.419 1.21,0 2.176,1.096 2.157,2.42 0,1.333 -0.956,2.418 -2.157,2.418zM15.98,15.33c-1.183,0 -2.157,-1.085 -2.157,-2.419 0,-1.333 0.955,-2.419 2.157,-2.419 1.21,0 2.176,1.096 2.157,2.42 0,1.333 -0.946,2.418 -2.157,2.418z", filled = true),
;
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt
index 68a8f19..04089f6 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/UiShot.kt
@@ -38,6 +38,8 @@ fun main(args: Array<String>) {
if (k == "theme") Palette.setNight(v == "night")
if (k == "brain") Settings.save(mapOf("brain" to v))
}
+ // `chat … wechat`: the conversation with the WeChat QR card open.
+ if (args.getOrElse(4) { "" } == "wechat") System.setProperty("andee.shot.wechat", "1")
if (args.getOrElse(4) { "" } == "empty") Scrollback.wipe() else seed()
@Suppress("UNUSED_VARIABLE") val unused = 0
if (args.getOrElse(4) { "" } == "pending") {
diff --git a/desktop/src/main/resources/wechat_qr.png b/desktop/src/main/resources/wechat_qr.png
new file mode 100644
index 0000000..66d6ee2
Binary files /dev/null and b/desktop/src/main/resources/wechat_qr.png differ