From 26936755d933d81ed9f837d6c4e7130794f78f15 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sun, 13 Nov 2016 17:42:26 +0000
Subject: [PATCH 1/2] Bugfix: Locations without coordinates aren't good for
 Diaspora

---
 include/diaspora.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/diaspora.php b/include/diaspora.php
index db6844f44d..9e3710e2d0 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -2876,8 +2876,9 @@ class diaspora {
 					"created_at" => $created,
 					"provider_display_name" => $item["app"]);
 
-			if (count($location) == 0)
+			if (!isset($location["lat"]) OR !isset($location["lng"])) {
 				unset($message["location"]);
+			}
 
 			$type = "status_message";
 		}

From e925c4139c17e43708426bb296a08b39e6fe8e8b Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Sun, 13 Nov 2016 18:28:55 +0000
Subject: [PATCH 2/2] Some documentation

---
 include/diaspora.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/diaspora.php b/include/diaspora.php
index 9e3710e2d0..10f1be93d2 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -2876,6 +2876,7 @@ class diaspora {
 					"created_at" => $created,
 					"provider_display_name" => $item["app"]);
 
+			// Diaspora rejects messages when they contain a location without "lat" or "lng"
 			if (!isset($location["lat"]) OR !isset($location["lng"])) {
 				unset($message["location"]);
 			}