X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fcommon%2Fagendav_plugin.rb;fp=lib%2Fcommon%2Fagendav_plugin.rb;h=4c3a5cff3bc4a1acef6270a8de55ce7d800f5a8d;hp=49e7087d996ce2de850a01ec3c6d0a785b0ecd06;hb=f77d8736406afb1fcf017dbc6b2ce780f5cde5be;hpb=313f50286308da3e0669d477e7d6ad1c5937c24b diff --git a/lib/common/agendav_plugin.rb b/lib/common/agendav_plugin.rb index 49e7087..4c3a5cf 100644 --- a/lib/common/agendav_plugin.rb +++ b/lib/common/agendav_plugin.rb @@ -35,9 +35,11 @@ module AgendavPlugin connection = PG::Connection.new(@db_hash) - sql_query = '(SELECT username FROM prefs)' - sql_query += 'UNION' - sql_query += '(SELECT user_from FROM shared);' + # There's also an "owner" field in the "shares" table, but it + # contains a principal URL and not a bare username. Thus its + # format depends on the CalDAV server configuration, and isn't + # predictable. + sql_query = 'SELECT username FROM prefs' begin connection.query(sql_query) do |result|