r6911 - in dumbhippo/trunk/server/src/com/dumbhippo/server: dm impl
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r6911 - in dumbhippo/trunk/server/src/com/dumbhippo/server: dm impl
- Date: Wed, 14 Nov 2007 14:10:32 -0600 (CST)
Author: hp
Date: 2007-11-14 14:10:29 -0600 (Wed, 14 Nov 2007)
New Revision: 6911
Modified:
dumbhippo/trunk/server/src/com/dumbhippo/server/dm/UserDMO.java
dumbhippo/trunk/server/src/com/dumbhippo/server/impl/IdentitySpiderBean.java
Log:
add some comments about contacters
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/dm/UserDMO.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/dm/UserDMO.java 2007-11-14 16:56:55 UTC (rev 6910)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/dm/UserDMO.java 2007-11-14 20:10:29 UTC (rev 6911)
@@ -52,11 +52,15 @@
private TrackHistory currentTrack;
private boolean currentTrackFetched;
-
- private Set<UserDMO> blockingContacters;
+
+ // people who have any opinion of this UserDMO except blocked
private Set<UserDMO> contacters; /* Includes hot/medium/cold contacters */
+ // people who have pinned this UserDMO in their "top N"
private Set<UserDMO> hotContacters;
+ // people who never want this UserDMO in their pinned "top N"
private Set<UserDMO> coldContacters;
+ // people who have blocked this UserDMO
+ private Set<UserDMO> blockingContacters;
@Inject
private EntityManager em;
@@ -203,7 +207,7 @@
return hotContacters;
}
- private boolean isInContacterSet(String propertyName) {
+ private boolean viewerIsInContacterSet(String propertyName) {
if (viewpoint instanceof UserViewpoint) {
try {
@SuppressWarnings("unchecked")
@@ -220,17 +224,18 @@
}
}
+ /* Gets the ContactStatus the viewer has applied to this user */
@DMProperty(cached=false)
public int getContactStatus() {
ContactStatus status;
- if (isInContacterSet("blockingContacters"))
+ if (viewerIsInContacterSet("blockingContacters"))
status = ContactStatus.BLOCKED;
- else if (!isInContacterSet("contacters"))
+ else if (!viewerIsInContacterSet("contacters"))
status = ContactStatus.NONCONTACT;
- else if (isInContacterSet("hotContacters"))
+ else if (viewerIsInContacterSet("hotContacters"))
status = ContactStatus.HOT;
- else if (isInContacterSet("coldContacters"))
+ else if (viewerIsInContacterSet("coldContacters"))
status = ContactStatus.COLD;
else
status = ContactStatus.MEDIUM;
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/IdentitySpiderBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/IdentitySpiderBean.java 2007-11-14 16:56:55 UTC (rev 6910)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/IdentitySpiderBean.java 2007-11-14 20:10:29 UTC (rev 6911)
@@ -698,6 +698,9 @@
return result;
}
+ // computes which user GUIDs have a contact which points to a resource
+ // which is proven-owned (AccountClaim) by the passed-in user.
+ // "People who say they have a ContactStatus with respect to userId"
public Set<Guid> computeContacters(Guid userId) {
Query q = em.createQuery("SELECT cc.account.owner.id " +
" FROM ContactClaim cc, AccountClaim ac " +
@@ -717,6 +720,9 @@
return result;
}
+ // like computeContacters(), but also returns the status that someone has
+ // assigned to userId. i.e. returns people who have assigned userId a ContactStatus,
+ // plus that ContactStatus they have assigned.
public List<Pair<Guid,ContactStatus>> computeContactersWithStatus(Guid userId) {
Query q = em.createQuery("SELECT cc.account.owner.id, cc.contact.status " +
" FROM ContactClaim cc, AccountClaim ac " +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]