usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [1/3] usergrid git commit: Fix issue where user scoped notification requests were not finding devices to send notifications to.
Date Tue, 29 Dec 2015 23:00:19 GMT
Repository: usergrid
Updated Branches:
  refs/heads/master db26ba723 -> 1cdefdb72


Fix issue where user scoped notification requests were not finding devices to send notifications
to.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/57279250
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/57279250
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/57279250

Branch: refs/heads/master
Commit: 57279250e473b60e6324327ce8d67c976aadef41
Parents: fdc0d80
Author: Michael Russo <michaelarusso@gmail.com>
Authored: Tue Dec 22 22:02:41 2015 -0800
Committer: Michael Russo <michaelarusso@gmail.com>
Committed: Tue Dec 22 22:02:41 2015 -0800

----------------------------------------------------------------------
 .../usergrid/persistence/entities/Notification.java       | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/57279250/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
index 362201a..096706b 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/entities/Notification.java
@@ -304,7 +304,15 @@ public class Notification extends TypedEntity {
                 String collection = pathToken.getCollection();
                 Query query = new Query();
                 if (pathToken.getIdentifier()!=null) {
-                    query.addIdentifier(pathToken.getIdentifier());
+
+                    // users collection is special case and uses "username" instaed of "name"
+                    // build a query using QL with "username" as Identifier.Type.USERNAME
doesn't exist
+                    if (collection.equals("users") && pathToken.getIdentifier().getType()
== Identifier.Type.NAME){
+                        query.setQl("select * where username ='"+pathToken.getIdentifier().getName()+"'");
+                    }else{
+                        query.addIdentifier(pathToken.getIdentifier());
+                    }
+
                 }
                 query.setLimit(100);
                 query.setCollection(collection);


Mime
View raw message