<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13756] CalendarServer/branches/users/gaya/groupsharee2/txdav</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/13756">13756</a></dd>
<dt>Author</dt> <dd>gaya@apple.com</dd>
<dt>Date</dt> <dd>2014-07-14 15:12:05 -0700 (Mon, 14 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Checkpoint changes</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServerbranchesusersgayagroupsharee2txdavcaldavdatastoresqlpy">CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesusersgayagroupsharee2txdavcaldavdatastoretesttest_sql_sharingpy">CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/test/test_sql_sharing.py</a></li>
<li><a href="#CalendarServerbranchesusersgayagroupsharee2txdavcommondatastoresqlpy">CalendarServer/branches/users/gaya/groupsharee2/txdav/common/datastore/sql.py</a></li>
<li><a href="#CalendarServerbranchesusersgayagroupsharee2txdavwhoaugmentpy">CalendarServer/branches/users/gaya/groupsharee2/txdav/who/augment.py</a></li>
<li><a href="#CalendarServerbranchesusersgayagroupsharee2txdavwhogroupspy">CalendarServer/branches/users/gaya/groupsharee2/txdav/who/groups.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServerbranchesusersgayagroupsharee2txdavcaldavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/sql.py (13755 => 13756)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/sql.py        2014-07-12 01:30:42 UTC (rev 13755)
+++ CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/sql.py        2014-07-14 22:12:05 UTC (rev 13756)
</span><span class="lines">@@ -1815,13 +1815,24 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         return group mode after removing one group sharee or None
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        # if more than one group
</del><ins>+        # count group sharees that self is member of
</ins><span class="cx">         gs = schema.GROUP_SHAREE
</span><ins>+        gm = schema.GROUP_MEMBERSHIP
</ins><span class="cx">         rows = yield Select(
</span><span class="cx">             [Count(gs.GROUP_ID)],
</span><span class="cx">             From=gs,
</span><del>-            Where=gs.CALENDAR_ID == self._resourceID
-        ).on(self._txn)
</del><ins>+             Where=(
+                gs.GROUP_ID.In(
+                    Select(
+                        [gm.GROUP_ID],
+                        From=gm,
+                        Where=(
+                            gm.MEMBER_UID == Parameter(&quot;uid&quot;)
+                        )
+                    )
+                )
+            )
+        ).on(self._txn, uid=self.viewerHome().uid())
</ins><span class="cx">         if rows[0][0] &gt; 0:
</span><span class="cx">             # no mode change for group shares
</span><span class="cx">             returnValue(
</span><span class="lines">@@ -1946,20 +1957,24 @@
</span><span class="cx">         yield self.updateShareeGroupLink(shareeUID, mode=mode)
</span><span class="cx"> 
</span><span class="cx">         # invite every member of group
</span><del>-        shareeViews = set()
</del><ins>+        shareeViews = []
</ins><span class="cx">         groupID = (yield self._txn.groupByUID(shareeUID))[0]
</span><span class="cx">         memberUIDs = yield self._txn.groupMemberUIDs(groupID)
</span><span class="cx">         for memberUID in memberUIDs:
</span><del>-            shareeView = yield self.shareeView(memberUID)
-            newMode = _BIND_MODE_GROUP if shareeView is None else shareeView.groupModeAfterAddingOneGroupSharee()
-            if newMode is not None:
-                # everything but direct share
-                shareeView = yield super(Calendar, self).inviteUIDToShare(memberUID, newMode, summary)
-                shareeViews.add(shareeView)
</del><ins>+            if memberUID != self._home.uid():
+                shareeView = yield self.shareeView(memberUID)
+                newMode = _BIND_MODE_GROUP if shareeView is None else shareeView.groupModeAfterAddingOneGroupSharee()
+                if newMode is not None:
+                    # everything but direct
+                    shareeView = yield super(Calendar, self).inviteUIDToShare(memberUID, newMode, summary)
+                    shareeViews.append(shareeView)
</ins><span class="cx"> 
</span><del>-        returnValue(shareeViews)
</del><ins>+        # shared even if no sharees
+        yield self.setShared(True)
</ins><span class="cx"> 
</span><ins>+        returnValue(tuple(shareeViews))
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def directShareWithUser(self, shareeUID, shareName=None):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -2013,17 +2028,17 @@
</span><span class="cx">                 # uninvite each member of group
</span><span class="cx">                 memberUIDs = yield self._txn.groupMemberUIDs(groupID)
</span><span class="cx">                 for memberUID in memberUIDs:
</span><del>-                    shareeView = yield self.shareeView(memberUID)
-                    if shareeView is not None:
</del><ins>+                    if memberUID != self._home.uid():
+                        shareeView = yield self.shareeView(memberUID)
+                        if shareeView is not None:
+                            newMode = yield shareeView._groupModeAfterRemovingOneGroupSharee()
+                            if newMode is None:
+                                # only group was shared, do delete share
+                                yield super(Calendar, self).uninviteUIDFromShare(memberUID)
+                            else:
+                                # multiple groups or group and individual was shared, update to new mode
+                                yield super(Calendar, self).inviteUIDToShare(memberUID, newMode)
</ins><span class="cx"> 
</span><del>-                        newMode = yield shareeView._groupModeAfterRemovingOneGroupSharee()
-                        if newMode is None:
-                            # only group was shared, do delete share
-                            yield super(Calendar, self).uninviteUIDFromShare(memberUID)
-                        else:
-                            # multiple groups or group and individual was shared, update to new mode
-                            yield super(Calendar, self).inviteUIDToShare(memberUID, newMode)
-
</del><span class="cx">                 returnValue(None)
</span><span class="cx"> 
</span><span class="cx">         returnValue(
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayagroupsharee2txdavcaldavdatastoretesttest_sql_sharingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/test/test_sql_sharing.py (13755 => 13756)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/test/test_sql_sharing.py        2014-07-12 01:30:42 UTC (rev 13755)
+++ CalendarServer/branches/users/gaya/groupsharee2/txdav/caldav/datastore/test/test_sql_sharing.py        2014-07-14 22:12:05 UTC (rev 13756)
</span><span class="lines">@@ -634,24 +634,64 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def test_invite_sharee(self):
</del><ins>+    def test_invite_empty_group(self):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Test invite/uninvite creates/removes shares and notifications.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><ins>+        yield self._check_notifications(&quot;user01&quot;, [])
+
</ins><span class="cx">         # Invite
</span><span class="cx">         calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
</span><span class="cx">         invites = yield calendar.sharingInvites()
</span><span class="cx">         self.assertEqual(len(invites), 0)
</span><span class="cx">         self.assertFalse(calendar.isShared())
</span><span class="cx"> 
</span><ins>+        yield self._check_notifications(&quot;user01&quot;, [])
+        shareeViews = yield calendar.inviteUIDToShare(&quot;group01&quot;, _BIND_MODE_READ, &quot;summary&quot;)
+        self.assertEqual(len(shareeViews), 0)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 0)
+
+        self.assertTrue(calendar.isShared())
+
+        yield self.commit()
+
+        # Uninvite
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        yield calendar.uninviteUIDFromShare(&quot;group01&quot;)
+        noinvites = yield calendar.sharingInvites()
+        self.assertEqual(len(noinvites), 0)
+
+        yield self.commit()
+
+        yield self._check_notifications(&quot;user01&quot;, [])
+
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
+        yield calendar.setShared(False)
+        self.assertFalse(calendar.isShared())
+
+
+    @inlineCallbacks
+    def test_invite_group(self):
+        &quot;&quot;&quot;
+        Test invite/uninvite creates/removes shares and notifications.
+        &quot;&quot;&quot;
+
+        # Invite
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 0)
+        self.assertFalse(calendar.isShared())
+
</ins><span class="cx">         shareeViews = yield calendar.inviteUIDToShare(&quot;group02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
</span><span class="cx">         self.assertEqual(len(shareeViews), 3)
</span><span class="cx">         invites = yield calendar.sharingInvites()
</span><span class="cx">         self.assertEqual(len(invites), 3)
</span><span class="cx">         shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
</span><span class="cx">         invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
</span><del>-        for i in range(3):
</del><ins>+        for i in range(len(invites)):
</ins><span class="cx">             self.assertEqual(invites[i].uid, shareeViews[i].shareUID())
</span><span class="cx">             self.assertEqual(invites[i].ownerUID, &quot;user01&quot;)
</span><span class="cx">             self.assertEqual(invites[i].shareeUID, shareeViews[i].viewerHome().uid())
</span><span class="lines">@@ -676,7 +716,7 @@
</span><span class="cx">         self.assertEqual(len(uninvites), 0)
</span><span class="cx">         self.assertTrue(calendar.isShared())
</span><span class="cx"> 
</span><del>-        for i in range(3):
</del><ins>+        for i in range(len(invites)):
</ins><span class="cx">             yield self._check_notifications(invites[i].shareeUID, [])
</span><span class="cx"> 
</span><span class="cx">         yield self.commit()
</span><span class="lines">@@ -705,7 +745,7 @@
</span><span class="cx">         self.assertEqual(len(invites), 3)
</span><span class="cx">         shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
</span><span class="cx">         invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
</span><del>-        for i in range(3):
</del><ins>+        for i in range(len(invites)):
</ins><span class="cx">             self.assertEqual(invites[i].uid, shareeViews[i].shareUID())
</span><span class="cx">             self.assertEqual(invites[i].ownerUID, &quot;user01&quot;)
</span><span class="cx">             self.assertEqual(invites[i].shareeUID, shareeViews[i].viewerHome().uid())
</span><span class="lines">@@ -741,7 +781,7 @@
</span><span class="cx">         calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
</span><span class="cx">         self.assertTrue(calendar.isShared())
</span><span class="cx"> 
</span><del>-    '''
</del><ins>+
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_decline_share(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -749,52 +789,54 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         # Invite
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        invites = yield group.sharingInvites()
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        invites = yield calendar.sharingInvites()
</ins><span class="cx">         self.assertEqual(len(invites), 0)
</span><del>-        self.assertFalse(group.isShared())
</del><ins>+        self.assertFalse(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        shareeView = yield group.inviteUIDToShare(&quot;user02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
-        invites = yield group.sharingInvites()
-        self.assertEqual(len(invites), 1)
-        inviteUID = shareeView.shareUID()
</del><ins>+        shareeViews = yield calendar.inviteUIDToShare(&quot;group02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
+        self.assertEqual(len(shareeViews), 3)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 3)
+        shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
+        invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
+        for i in range(len(invites)):
+            self.assertEqual(invites[i].uid, shareeViews[i].shareUID())
+            self.assertEqual(invites[i].ownerUID, &quot;user01&quot;)
+            self.assertEqual(invites[i].shareeUID, shareeViews[i].viewerHome().uid())
+            self.assertEqual(invites[i].mode, _BIND_MODE_GROUP)
+            self.assertEqual((yield shareeViews[i].effectiveShareMode()), _BIND_MODE_READ)
+            self.assertEqual(invites[i].status, _BIND_STATUS_INVITED)
+            self.assertEqual(invites[i].summary, &quot;summary&quot;)
+            yield self._check_notifications(invites[i].shareeUID, [invites[i].uid, ])
</ins><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><ins>+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        yield self._check_notifications(&quot;user02&quot;, [inviteUID, ])
-
-        self.assertTrue(group.isShared())
-
</del><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         # Decline
</span><del>-        shareeHome = yield self.homeUnderTest(name=&quot;user02&quot;)
-        yield shareeHome.declineShare(inviteUID)
</del><ins>+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.declineShare(invite.uid)
</ins><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><ins>+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
</ins><span class="cx"> 
</span><del>-        yield self._check_notifications(&quot;user01&quot;, [inviteUID + &quot;-reply&quot;, ])
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        self.assertTrue(group.isShared())
-
</del><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         # Re-decline
</span><del>-        shareeHome = yield self.homeUnderTest(name=&quot;user02&quot;)
-        yield shareeHome.declineShare(inviteUID)
</del><ins>+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.declineShare(invite.uid)
</ins><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><ins>+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
</ins><span class="cx"> 
</span><del>-        yield self._check_notifications(&quot;user01&quot;, [inviteUID + &quot;-reply&quot;, ])
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        self.assertTrue(group.isShared())
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_accept_decline_share(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -803,49 +845,53 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         # Invite
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        invites = yield group.sharingInvites()
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        invites = yield calendar.sharingInvites()
</ins><span class="cx">         self.assertEqual(len(invites), 0)
</span><del>-        self.assertFalse(group.isShared())
</del><ins>+        self.assertFalse(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        shareeView = yield group.inviteUIDToShare(&quot;user02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
-        invites = yield group.sharingInvites()
-        self.assertEqual(len(invites), 1)
-        inviteUID = shareeView.shareUID()
</del><ins>+        shareeViews = yield calendar.inviteUIDToShare(&quot;group02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
+        self.assertEqual(len(shareeViews), 3)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 3)
+        shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
+        invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
+        for i in range(len(invites)):
+            self.assertEqual(invites[i].uid, shareeViews[i].shareUID())
+            self.assertEqual(invites[i].ownerUID, &quot;user01&quot;)
+            self.assertEqual(invites[i].shareeUID, shareeViews[i].viewerHome().uid())
+            self.assertEqual(invites[i].mode, _BIND_MODE_GROUP)
+            self.assertEqual((yield shareeViews[i].effectiveShareMode()), _BIND_MODE_READ)
+            self.assertEqual(invites[i].status, _BIND_STATUS_INVITED)
+            self.assertEqual(invites[i].summary, &quot;summary&quot;)
+            yield self._check_notifications(invites[i].shareeUID, [invites[i].uid, ])
</ins><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><ins>+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        yield self._check_notifications(&quot;user02&quot;, [inviteUID, ])
-
-        self.assertTrue(group.isShared())
-
</del><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         # Accept
</span><del>-        shareeHome = yield self.homeUnderTest(name=&quot;user02&quot;)
-        yield shareeHome.acceptShare(inviteUID)
</del><ins>+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.acceptShare(invite.uid)
</ins><span class="cx"> 
</span><del>-        yield self._check_calendar(&quot;user02&quot;, &quot;user01&quot;, self.group1_children)
-        yield self._check_notifications(&quot;user01&quot;, [inviteUID + &quot;-reply&quot;, ])
</del><ins>+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
</ins><span class="cx"> 
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        self.assertTrue(group.isShared())
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         # Decline
</span><del>-        shareeHome = yield self.homeUnderTest(name=&quot;user02&quot;)
-        yield shareeHome.declineShare(inviteUID)
</del><ins>+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.declineShare(invite.uid)
</ins><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><ins>+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
</ins><span class="cx"> 
</span><del>-        yield self._check_notifications(&quot;user01&quot;, [inviteUID + &quot;-reply&quot;, ])
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        self.assertTrue(group.isShared())
-    '''
</del><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_accept_remove_share(self):
</span><span class="lines">@@ -855,95 +901,238 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         # Invite
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        invites = yield group.sharingInvites()
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        invites = yield calendar.sharingInvites()
</ins><span class="cx">         self.assertEqual(len(invites), 0)
</span><ins>+        self.assertFalse(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        shareeView = yield group.inviteUIDToShare(&quot;user02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
-        invites = yield group.sharingInvites()
-        self.assertEqual(len(invites), 1)
-        inviteUID = shareeView.shareUID()
</del><ins>+        shareeViews = yield calendar.inviteUIDToShare(&quot;group02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
+        self.assertEqual(len(shareeViews), 3)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 3)
+        shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
+        invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
+        for i in range(len(invites)):
+            self.assertEqual(invites[i].uid, shareeViews[i].shareUID())
+            self.assertEqual(invites[i].ownerUID, &quot;user01&quot;)
+            self.assertEqual(invites[i].shareeUID, shareeViews[i].viewerHome().uid())
+            self.assertEqual(invites[i].mode, _BIND_MODE_GROUP)
+            self.assertEqual((yield shareeViews[i].effectiveShareMode()), _BIND_MODE_READ)
+            self.assertEqual(invites[i].status, _BIND_STATUS_INVITED)
+            self.assertEqual(invites[i].summary, &quot;summary&quot;)
+            yield self._check_notifications(invites[i].shareeUID, [invites[i].uid, ])
</ins><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><ins>+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        yield self._check_notifications(&quot;user02&quot;, [inviteUID, ])
-
</del><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         # Accept
</span><del>-        shareeHome = yield self.homeUnderTest(name=&quot;user02&quot;)
-        yield shareeHome.acceptShare(inviteUID)
</del><ins>+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.acceptShare(invite.uid)
</ins><span class="cx"> 
</span><del>-        yield self._check_calendar(&quot;user02&quot;, &quot;user01&quot;, self.group1_children)
-        yield self._check_notifications(&quot;user01&quot;, [inviteUID + &quot;-reply&quot;, ])
</del><ins>+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
</ins><span class="cx"> 
</span><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
+
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         # Delete
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user02&quot;, calendar_name=&quot;user01&quot;, name=&quot;group1.vcf&quot;)
-        yield group.deleteShare()
</del><ins>+        for invite in invites:
+            shareeCalendar = yield self.calendarUnderTest(home=invite.shareeUID, name=invite.uid)
+            yield shareeCalendar.deleteShare()
</ins><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><ins>+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
</ins><span class="cx"> 
</span><del>-        yield self._check_notifications(&quot;user01&quot;, [inviteUID + &quot;-reply&quot;, ])
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><ins>+    def test_accept_uninvite_group(self):
+        &quot;&quot;&quot;
+        Test that invite+accept/decline creates/removes shares and notifications.
+        Decline via the shared collection (removal).
+        &quot;&quot;&quot;
+
+        # Invite
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 0)
+        self.assertFalse(calendar.isShared())
+
+        shareeViews = yield calendar.inviteUIDToShare(&quot;group02&quot;, _BIND_MODE_READ, &quot;summary&quot;)
+        self.assertEqual(len(shareeViews), 3)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 3)
+        shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
+        invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
+        for i in range(len(invites)):
+            self.assertEqual(invites[i].uid, shareeViews[i].shareUID())
+            self.assertEqual(invites[i].ownerUID, &quot;user01&quot;)
+            self.assertEqual(invites[i].shareeUID, shareeViews[i].viewerHome().uid())
+            self.assertEqual(invites[i].mode, _BIND_MODE_GROUP)
+            self.assertEqual((yield shareeViews[i].effectiveShareMode()), _BIND_MODE_READ)
+            self.assertEqual(invites[i].status, _BIND_STATUS_INVITED)
+            self.assertEqual(invites[i].summary, &quot;summary&quot;)
+            yield self._check_notifications(invites[i].shareeUID, [invites[i].uid, ])
+
+        self.assertTrue(calendar.isShared())
+
+        yield self.commit()
+
+        # Accept
+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.acceptShare(invite.uid)
+
+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
+
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
+
+        yield self.commit()
+
+        # Uninvite
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        yield calendar.uninviteUIDFromShare(&quot;group02&quot;)
+        noinvites = yield calendar.sharingInvites()
+        self.assertEqual(len(noinvites), 0)
+
+        yield self.commit()
+
+        # no extra notifications
+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
+
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
+
+
+    @inlineCallbacks
</ins><span class="cx">     def test_accept_two_groups(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Test that accept of two groups works.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        # Two shares
-        inviteUID1 = yield self._createGroupShare(groupname=&quot;group1.vcf&quot;)
-        inviteUID2 = yield self._createGroupShare(groupname=&quot;group2.vcf&quot;)
</del><ins>+        # Invite
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 0)
+        self.assertFalse(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        yield self._check_calendar(&quot;user02&quot;, &quot;user01&quot;, self.all_children)
-        yield self._check_notifications(&quot;user01&quot;, [inviteUID1 + &quot;-reply&quot;, inviteUID2 + &quot;-reply&quot;, ])
</del><ins>+        shareeViewsGroup02 = yield calendar.inviteUIDToShare(&quot;group02&quot;, _BIND_MODE_WRITE, &quot;summary&quot;)
+        self.assertEqual(len(shareeViewsGroup02), 3)
+        shareeViewsGroup03 = yield calendar.inviteUIDToShare(&quot;group03&quot;, _BIND_MODE_READ, &quot;summary&quot;)
+        self.assertEqual(len(shareeViewsGroup03), 3)
+        shareeViews = dict([(shareeView.shareUID(), shareeView) for shareeView in shareeViewsGroup02 + shareeViewsGroup03]).values()
+        self.assertEqual(len(shareeViews), 4)
+        shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 4)
+        invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
+        for i in range(len(invites)):
+            shareeView = shareeViews[i]
+            invite = invites[i]
+            self.assertEqual(invite.uid, shareeView.shareUID())
+            self.assertEqual(invite.ownerUID, &quot;user01&quot;)
+            self.assertEqual(invite.shareeUID, shareeView.viewerHome().uid())
+            self.assertEqual(invite.mode, _BIND_MODE_GROUP)
+            self.assertEqual((yield shareeView.effectiveShareMode()), _BIND_MODE_WRITE if shareeView in shareeViewsGroup02 else _BIND_MODE_READ)
+            self.assertEqual(invite.status, _BIND_STATUS_INVITED)
+            self.assertEqual(invite.summary, &quot;summary&quot;)
+            yield self._check_notifications(invite.shareeUID, [invite.uid, ])
</ins><span class="cx"> 
</span><ins>+        yield self.commit()
</ins><span class="cx"> 
</span><ins>+        # accept
+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.acceptShare(invite.uid)
+
+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
+
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
+
+        yield self.commit()
+
+
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_accept_uninvite_two_groups(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Test that accept of two groups works, then uninvite each one.
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        # Two shares
-        inviteUID1 = yield self._createGroupShare(groupname=&quot;group1.vcf&quot;)
-        inviteUID2 = yield self._createGroupShare(groupname=&quot;group2.vcf&quot;)
</del><ins>+        # Invite
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 0)
+        self.assertFalse(calendar.isShared())
</ins><span class="cx"> 
</span><del>-        yield self._check_calendar(&quot;user02&quot;, &quot;user01&quot;, self.all_children)
-        yield self._check_notifications(&quot;user01&quot;, [inviteUID1 + &quot;-reply&quot;, inviteUID2 + &quot;-reply&quot;, ])
</del><ins>+        shareeViewsGroup02 = yield calendar.inviteUIDToShare(&quot;group02&quot;, _BIND_MODE_WRITE, &quot;summary&quot;)
+        self.assertEqual(len(shareeViewsGroup02), 3)
+        shareeViewsGroup03 = yield calendar.inviteUIDToShare(&quot;group03&quot;, _BIND_MODE_READ, &quot;summary&quot;)
+        self.assertEqual(len(shareeViewsGroup03), 3)
+        shareeViews = dict([(shareeView.shareUID(), shareeView) for shareeView in shareeViewsGroup02 + shareeViewsGroup03]).values()
+        self.assertEqual(len(shareeViews), 4)
+        shareeViews = sorted(shareeViews, key=lambda shareeView: shareeView.viewerHome().uid())
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 4)
+        invites = sorted(invites, key=lambda invitee: invitee.shareeUID)
+        for i in range(len(invites)):
+            shareeView = shareeViews[i]
+            invite = invites[i]
+            self.assertEqual(invite.uid, shareeView.shareUID())
+            self.assertEqual(invite.ownerUID, &quot;user01&quot;)
+            self.assertEqual(invite.shareeUID, shareeView.viewerHome().uid())
+            self.assertEqual(invite.mode, _BIND_MODE_GROUP)
+            self.assertEqual((yield shareeView.effectiveShareMode()), _BIND_MODE_WRITE if shareeView in shareeViewsGroup02 else _BIND_MODE_READ)
+            self.assertEqual(invite.status, _BIND_STATUS_INVITED)
+            self.assertEqual(invite.summary, &quot;summary&quot;)
+            yield self._check_notifications(invite.shareeUID, [invite.uid, ])
</ins><span class="cx"> 
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        # Uninvite one
-        group = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;, name=&quot;group1.vcf&quot;)
-        yield group.uninviteUIDFromShare(&quot;user02&quot;)
-        invites = yield group.sharingInvites()
-        self.assertEqual(len(invites), 0)
</del><ins>+        # accept
+        for invite in invites:
+            shareeHome = yield self.homeUnderTest(name=invite.shareeUID)
+            yield shareeHome.acceptShare(invite.uid)
</ins><span class="cx"> 
</span><del>-        yield self._check_calendar(&quot;user02&quot;, &quot;user01&quot;, self.group2_children)
</del><ins>+        yield self._check_notifications(&quot;user01&quot;, [invite.uid + &quot;-reply&quot; for invite in invites])
</ins><span class="cx"> 
</span><del>-        shared = yield self.calendarObjectUnderTest(home=&quot;user02&quot;, calendar_name=&quot;user01&quot;, name=&quot;group1.vcf&quot;)
-        self.assertTrue(shared is None)
-        shared = yield self.calendarObjectUnderTest(home=&quot;user02&quot;, calendar_name=&quot;user01&quot;, name=&quot;card2.vcf&quot;)
-        self.assertTrue(shared is None)
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        self.assertTrue(calendar.isShared())
</ins><span class="cx"> 
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><ins>+        # Uninvite one
+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        yield calendar.uninviteUIDFromShare(&quot;group02&quot;)
+        invites = yield calendar.sharingInvites()
+        self.assertEqual(len(invites), 3)
+
+        for invite in invites:
+            shareeView = yield self.calendarUnderTest(home=invite.shareeUID, name=invite.uid)
+            self.assertNotEqual(shareeView, None)
+            self.assertEqual(invite.ownerUID, &quot;user01&quot;)
+            self.assertEqual(invite.shareeUID, shareeView.viewerHome().uid())
+            self.assertEqual(invite.mode, _BIND_MODE_GROUP)
+            self.assertEqual((yield shareeView.effectiveShareMode()), _BIND_MODE_READ)
+            self.assertEqual(invite.status, _BIND_STATUS_ACCEPTED)
+            self.assertEqual(invite.summary, &quot;summary&quot;)
+            yield self._check_notifications(invite.shareeUID, [invite.uid, ])
+
+        yield self.commit()
+
</ins><span class="cx">         # Uninvite other
</span><del>-        group = yield self.calendarObjectUnderTest(home=&quot;user02&quot;, calendar_name=&quot;user01&quot;, name=&quot;group2.vcf&quot;)
-        yield group.uninviteUIDFromShare(&quot;user02&quot;)
-        invites = yield group.sharingInvites()
</del><ins>+        calendar = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        yield calendar.uninviteUIDFromShare(&quot;group03&quot;)
+        invites = yield calendar.sharingInvites()
</ins><span class="cx">         self.assertEqual(len(invites), 0)
</span><span class="cx"> 
</span><del>-        sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
-        self.assertTrue(sharedParent is None)
</del><span class="cx"> 
</span><del>-
</del><ins>+    '''
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_accept_decline_two_groups(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -1020,9 +1209,9 @@
</span><span class="cx"> 
</span><span class="cx">         sharedParent = yield self.calendarUnderTest(home=&quot;user02&quot;, name=&quot;user01&quot;)
</span><span class="cx">         self.assertTrue(sharedParent is None)
</span><ins>+        '''
</ins><span class="cx"> 
</span><del>-
-
</del><ins>+'''
</ins><span class="cx"> class MixedSharing(BaseSharingTests):
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Test store-based combined address book and group book sharing.
</span><span class="lines">@@ -1184,3 +1373,4 @@
</span><span class="cx">             self.assertEqual(len(changed), 0)
</span><span class="cx">             self.assertEqual(len(deleted), 0)
</span><span class="cx">             self.assertEqual(len(invalid), 0)
</span><ins>+'''
</ins></span></pre></div>
<a id="CalendarServerbranchesusersgayagroupsharee2txdavcommondatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/groupsharee2/txdav/common/datastore/sql.py (13755 => 13756)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/groupsharee2/txdav/common/datastore/sql.py        2014-07-12 01:30:42 UTC (rev 13755)
+++ CalendarServer/branches/users/gaya/groupsharee2/txdav/common/datastore/sql.py        2014-07-14 22:12:05 UTC (rev 13756)
</span><span class="lines">@@ -1422,7 +1422,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><del>-    def groupsFor(self, uid):
</del><ins>+    def groupUIDsFor(self, uid):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Returns the cached set of UIDs for the groups this given uid is
</span><span class="cx">         a member of.
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayagroupsharee2txdavwhoaugmentpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/groupsharee2/txdav/who/augment.py (13755 => 13756)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/groupsharee2/txdav/who/augment.py        2014-07-12 01:30:42 UTC (rev 13755)
+++ CalendarServer/branches/users/gaya/groupsharee2/txdav/who/augment.py        2014-07-14 22:12:05 UTC (rev 13756)
</span><span class="lines">@@ -461,12 +461,12 @@
</span><span class="cx">     def groups(self):
</span><span class="cx">         augmented = []
</span><span class="cx"> 
</span><del>-        def _groupsFor(txn):
-            return txn.groupsFor(self.uid)
</del><ins>+        def _groupUIDsFor(txn):
+            return txn.groupUIDsFor(self.uid)
</ins><span class="cx"> 
</span><span class="cx">         groupUIDs = yield self.service._store.inTransaction(
</span><span class="cx">             &quot;AugmentedDirectoryRecord.groups&quot;,
</span><del>-            _groupsFor
</del><ins>+            _groupUIDsFor
</ins><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx">         for groupUID in groupUIDs:
</span></span></pre></div>
<a id="CalendarServerbranchesusersgayagroupsharee2txdavwhogroupspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/branches/users/gaya/groupsharee2/txdav/who/groups.py (13755 => 13756)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/branches/users/gaya/groupsharee2/txdav/who/groups.py        2014-07-12 01:30:42 UTC (rev 13755)
+++ CalendarServer/branches/users/gaya/groupsharee2/txdav/who/groups.py        2014-07-14 22:12:05 UTC (rev 13756)
</span><span class="lines">@@ -406,7 +406,7 @@
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         The UIDs of the groups the uid is a member of
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        return txn.groupsFor(uid)
</del><ins>+        return txn.groupUIDsFor(uid)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span></span></pre>
</div>
</div>

</body>
</html>