Commit b64c2739 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Use the VCardManager for deleting vCards. JM-339


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1652 b35dd754-fafc-0310-a699-88a17e54d16e
parent 72252a09
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
package org.jivesoftware.messenger.user; package org.jivesoftware.messenger.user;
import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.messenger.vcard.VCardManager;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.util.StringUtils; import org.jivesoftware.util.StringUtils;
import org.jivesoftware.util.LocaleUtils;
import java.sql.*; import java.sql.*;
import java.util.*; import java.util.*;
...@@ -40,8 +41,6 @@ public class DefaultUserProvider implements UserProvider { ...@@ -40,8 +41,6 @@ public class DefaultUserProvider implements UserProvider {
"VALUES (?,?,?,?,?,?)"; "VALUES (?,?,?,?,?,?)";
private static final String DELETE_USER_PROPS = private static final String DELETE_USER_PROPS =
"DELETE FROM jiveUserProp WHERE username=?"; "DELETE FROM jiveUserProp WHERE username=?";
private static final String DELETE_VCARD_PROPS =
"DELETE FROM jiveVCard WHERE username=?";
private static final String DELETE_USER = private static final String DELETE_USER =
"DELETE FROM jiveUser WHERE username=?"; "DELETE FROM jiveUser WHERE username=?";
private static final String UPDATE_NAME = private static final String UPDATE_NAME =
...@@ -146,10 +145,10 @@ public class DefaultUserProvider implements UserProvider { ...@@ -146,10 +145,10 @@ public class DefaultUserProvider implements UserProvider {
pstmt.execute(); pstmt.execute();
pstmt.close(); pstmt.close();
// Delete all of the users's vcard properties // Delete all of the users's vcard properties
pstmt = con.prepareStatement(DELETE_VCARD_PROPS); try {
pstmt.setString(1, username); VCardManager.getInstance().deleteVCard(username);
pstmt.execute(); }
pstmt.close(); catch (UnsupportedOperationException e) {}
// Delete the actual user entry // Delete the actual user entry
pstmt = con.prepareStatement(DELETE_USER); pstmt = con.prepareStatement(DELETE_USER);
pstmt.setString(1, username); pstmt.setString(1, username);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment