From ff78445596c91f522f44c7aa83735f0305a474bd Mon Sep 17 00:00:00 2001 From: hevin Date: Fri, 19 May 2017 15:25:52 +0800 Subject: [PATCH] Fix bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 离线图片消息缺少 localThumbailPath --- README.md | 2 +- package.json | 2 +- plugin.xml | 2 +- src/android/JMessagePlugin.java | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b5f0eb2..4c69f3e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # JMessage PhoneGap / Cordova Plugin -[![release](https://img.shields.io/badge/release-2.3.9-blue.svg)](https://github.com/jpush/jmessage-phonegap-plugin/releases) +[![release](https://img.shields.io/badge/release-2.4.0-blue.svg)](https://github.com/jpush/jmessage-phonegap-plugin/releases) [![platforms](https://img.shields.io/badge/platforms-iOS%7CAndroid-lightgrey.svg)](https://github.com/jpush/jmessage-phonegap-plugin) [![QQ Group](https://img.shields.io/badge/QQ%20Group-413602425-red.svg)](https://github.com/jpush/jmessage-phonegap-plugin) [![weibo](https://img.shields.io/badge/weibo-JPush-blue.svg)](http://weibo.com/jpush?refer_flag=1001030101_&is_all=1) diff --git a/package.json b/package.json index e3edcf8..ed2a5b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jmessage-phonegap-plugin", - "version": "2.3.9", + "version": "2.4.0", "description": "JMessage Cordova Plugin.", "cordova": { "id": "jmessage-phonegap-plugin", diff --git a/plugin.xml b/plugin.xml index aa0f147..13aabcf 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="2.4.0"> JMessage 集成极光 IM 和推送功能 diff --git a/src/android/JMessagePlugin.java b/src/android/JMessagePlugin.java index ef5055c..5f2cdbe 100644 --- a/src/android/JMessagePlugin.java +++ b/src/android/JMessagePlugin.java @@ -2967,10 +2967,10 @@ private JSONObject getMessageJSONObject(Message msg) throws JSONException { switch (msg.getContentType()) { case image: ImageContent imageContent = (ImageContent) msg.getContent(); - String imgPath = imageContent.getLocalPath(); - String imgLink = imageContent.getImg_link(); - msgJson.getJSONObject("content").put("imagePath", imgPath); - msgJson.getJSONObject("content").put("imageLink", imgLink); + if (!msgJson.getJSONObject("content").has("localThumbnailPath")) { + msgJson.getJSONObject("content").put("localThumbnailPath", + imageContent.getLocalThumbnailPath()); + } break; case voice: VoiceContent voiceContent = (VoiceContent) msg.getContent();