[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdeconnect-android] src/org/kde/kdeconnect/Plugins/TelephonyPlugin: Also send the contact photo
From: Àlex_Fiestas <afiestas () kde ! org>
Date: 2016-03-07 10:39:10
Message-ID: E1acsZC-0001wr-SV () scm ! kde ! org
[Download RAW message or body]
Git commit 07a9319c301502a12983d20aaafc1856a8e2164c by Àlex Fiestas.
Committed on 06/03/2016 at 20:58.
Pushed by afiestas into branch 'master'.
Also send the contact photo when a SMS is received
Pretty much like the phone call case.
M +9 -1 src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java
http://commits.kde.org/kdeconnect-android/07a9319c301502a12983d20aaafc1856a8e2164c
diff --git a/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java \
b/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java index \
2310536..9fdfcfc 100644
--- a/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java
+++ b/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java
@@ -182,9 +182,17 @@ public class TelephonyPlugin extends Plugin {
}
String phoneNumber = message.getOriginatingAddress();
+ Map<String, String> contactInfo = ContactsHelper.phoneNumberLookup(context, \
phoneNumber); if (phoneNumber != null) {
np.set("phoneNumber", phoneNumber);
- np.set("contactName", ContactsHelper.phoneNumberLookup(context, \
phoneNumber).get("name")); + }
+
+ if (contactInfo.containsKey("name")) {
+ np.set("contactName", contactInfo.get("name"));
+ }
+
+ if (contactInfo.containsKey("photoID")) {
+ np.set("phoneThumbnail", ContactsHelper.photoId64Encoded(context, \
contactInfo.get("photoID"))); }
device.sendPackage(np);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic