[tuxdroid-svn] r4665 - software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-g
Status: Beta
Brought to you by:
ks156
|
From: jerome <c2m...@c2...> - 2009-05-25 13:14:27
|
Author: jerome
Date: 2009-05-25 15:14:14 +0200 (Mon, 25 May 2009)
New Revision: 4665
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookFunctions.java
Log:
* Added functions to split notifications.
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookFunctions.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookFunctions.java 2009-05-25 12:56:57 UTC (rev 4664)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-facebook/trunk/tuxdroid-gadget-facebook/src/FacebookFunctions.java 2009-05-25 13:14:14 UTC (rev 4665)
@@ -357,4 +357,140 @@
return notifications;
}
+
+
+ /**
+ * Return email notifications.
+ */
+ public Integer getEmailNotifications()
+ {
+ if(this.notifications.containsKey("messages"))
+ {
+ return Integer.valueOf(this.notifications.get("messages").get(0));
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+
+ /**
+ * Return how many pokes user has.
+ * @return
+ */
+ public Integer getPokesCount()
+ {
+ if(this.notifications.containsKey("pokes"))
+ {
+ return Integer.valueOf(this.notifications.get("pokes").get(0));
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+
+ /**
+ * Return the number of friend requests.
+ * @return
+ */
+ public Integer getFriendRequestsCount()
+ {
+ if(this.notifications.containsKey("friend_requests"))
+ {
+ return Integer.valueOf(this.notifications.get("friend_requests").get(0));
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+
+ /**
+ * Return the name of people that ask to be a friend of user.
+ * @return
+ */
+ public Vector<String> getFriendRequestNames()
+ {
+ Vector<String> friends = new Vector<String>();
+
+ if(this.notifications.containsKey("friend_requests"))
+ {
+ Vector<String> dat = this.notifications.get("friend_requests");
+ dat.remove(0);
+ friends = dat;
+ }
+ return friends;
+ }
+
+
+ /**
+ * Return the number of availables groups invites.
+ * @return
+ */
+ public Integer getGroupsInvitesCount()
+ {
+ if(this.notifications.containsKey("group_invites"))
+ {
+ return Integer.valueOf(this.notifications.get("group_invites").get(0));
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+
+ /**
+ * Return the name of groups invites.
+ * @return
+ */
+ public Vector<String> getGroupInvitesNames()
+ {
+ Vector<String> groups = new Vector<String>();
+
+ if(this.notifications.containsKey("group_invites"))
+ {
+ Vector<String> dat = this.notifications.get("group_invites");
+ dat.remove(0);
+ groups = dat;
+ }
+ return groups;
+ }
+
+ /**
+ * Return the number of events invites.
+ * @return
+ */
+ public Integer getEventsInvitesCount()
+ {
+ if(this.notifications.containsKey("event_invites"))
+ {
+ return Integer.valueOf(this.notifications.get("event_invites").get(0));
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ /**
+ * Return the name of events invites.
+ * @return
+ */
+ public Vector<String> getEventInvitesNames()
+ {
+ Vector<String> events = new Vector<String>();
+
+ if(this.notifications.containsKey("event_invites"))
+ {
+ Vector<String> dat = this.notifications.get("event_invites");
+ dat.remove(0);
+ events = dat;
+ }
+ return events;
+ }
}
|