liuq 4 週間 前
コミット
d546d6307f
4 ファイル変更17 行追加5 行削除
  1. 13 1
      composables/useWebSocket.js
  2. 1 1
      manifest.json
  3. 2 2
      package-lock.json
  4. 1 1
      package.json

+ 13 - 1
composables/useWebSocket.js

@@ -102,6 +102,12 @@ export function useWebSocket(fetchContacts) {
 							body = '[图片]'
 						} else if (normalized.contentType === 'VIDEO') {
 							body = '[视频]'
+						} else if (normalized.contentType === 'USER_NOTIFICATION') {
+							body = normalized.title
+								? String(normalized.title).slice(0, 50)
+								: normalized.content
+									? String(normalized.content).slice(0, 50)
+									: '[通知]'
 						} else {
 							body = normalized.title || '[文件]'
 						}
@@ -123,7 +129,13 @@ export function useWebSocket(fetchContacts) {
 						preview = normalized.content ? String(normalized.content).slice(0, 50) : ''
 					} else if (normalized.contentType === 'IMAGE') preview = '[图片]'
 					else if (normalized.contentType === 'VIDEO') preview = '[视频]'
-					else preview = normalized.title || '[文件]'
+					else if (normalized.contentType === 'USER_NOTIFICATION') {
+						preview = normalized.title
+							? String(normalized.title).slice(0, 50)
+							: normalized.content
+								? String(normalized.content).slice(0, 50)
+								: '[通知]'
+					} else preview = normalized.title || '[文件]'
 					chatStore.updateContactPreview(cid, { lastMessage: preview, time: normalized.createdAt })
 				}
 			} catch (e) {

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "yunzhu-im-mobile-local",
+    "name" : "yunzhu-im-mobile",
     "appid" : "__UNI__6801EE3",
     "description" : "",
     "versionName" : "1.0.0",

+ 2 - 2
package-lock.json

@@ -1,11 +1,11 @@
 {
-  "name": "yunzhu-im-mobile-local",
+  "name": "yunzhu-im-mobile",
   "version": "1.0.0",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
-      "name": "yunzhu-im-mobile-local",
+      "name": "yunzhu-im-mobile",
       "version": "1.0.0",
       "license": "ISC",
       "devDependencies": {

+ 1 - 1
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "yunzhu-im-mobile-local",
+  "name": "yunzhu-im-mobile",
   "version": "1.0.0",
   "description": "",
   "main": "main.js",