summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Young <consult.awy@gmail.com>2015-06-29 12:27:04 (GMT)
committerAlan Young <consult.awy@gmail.com>2015-07-03 06:20:09 (GMT)
commit2b140e4789a654c68d1b534458be74c554e132d9 (patch)
tree1628bf7ceed2c3493acd83d12db61e4249a94df0
parentb13e0bd8d634df53f6a2d8bd3c1ceb3c84b84430 (diff)
downloadstroke-2b140e4789a654c68d1b534458be74c554e132d9.zip
stroke-2b140e4789a654c68d1b534458be74c554e132d9.tar.bz2
Make AvatarStorage available for client.
Change-Id: I03fa68c567250d938112ea9a0c236be100ac82e3
-rw-r--r--src/com/isode/stroke/client/Client.java8
-rw-r--r--src/com/isode/stroke/client/MemoryStorages.java11
-rw-r--r--src/com/isode/stroke/client/Storages.java4
3 files changed, 19 insertions, 4 deletions
diff --git a/src/com/isode/stroke/client/Client.java b/src/com/isode/stroke/client/Client.java
index 0ea6ad7..6938225 100644
--- a/src/com/isode/stroke/client/Client.java
+++ b/src/com/isode/stroke/client/Client.java
@@ -4,6 +4,8 @@
*/
package com.isode.stroke.client;
+import com.isode.stroke.avatars.AvatarManager;
+import com.isode.stroke.avatars.AvatarManagerImpl;
import com.isode.stroke.disco.CapsManager;
import com.isode.stroke.disco.ClientDiscoManager;
import com.isode.stroke.disco.EntityCapsManager;
@@ -54,6 +56,7 @@ public class Client extends CoreClient {
private final NickResolver nickResolver;
private final SubscriptionManager subscriptionManager;
private final ClientDiscoManager discoManager;
+ private final AvatarManager avatarManager;
final Signal1<Presence> onPresenceChange = new Signal1<Presence>();
@@ -98,6 +101,7 @@ public class Client extends CoreClient {
mucManager = new MUCManager(getStanzaChannel(), getIQRouter(), directedPresenceSender, mucRegistry);
vcardManager = new VCardManager(jid, getIQRouter(), getStorages().getVCardStorage());
+ avatarManager = new AvatarManagerImpl(vcardManager, getStanzaChannel(), getStorages().getAvatarStorage(), networkFactories.getCryptoProvider(), mucRegistry);
capsManager = new CapsManager(getStorages().getCapsStorage(), getStanzaChannel(), getIQRouter(), networkFactories.getCryptoProvider());
entityCapsManager = new EntityCapsManager(capsManager, getStanzaChannel());
@@ -190,6 +194,10 @@ public class Client extends CoreClient {
return vcardManager;
}
+ public AvatarManager getAvatarManager() {
+ return avatarManager;
+ }
+
private Storages getStorages() {
if (storages != null) {
return storages;
diff --git a/src/com/isode/stroke/client/MemoryStorages.java b/src/com/isode/stroke/client/MemoryStorages.java
index 9bd97a8..16d235d 100644
--- a/src/com/isode/stroke/client/MemoryStorages.java
+++ b/src/com/isode/stroke/client/MemoryStorages.java
@@ -4,6 +4,8 @@
*/
package com.isode.stroke.client;
+import com.isode.stroke.avatars.AvatarMemoryStorage;
+import com.isode.stroke.avatars.AvatarStorage;
import com.isode.stroke.crypto.CryptoProvider;
import com.isode.stroke.disco.CapsMemoryStorage;
import com.isode.stroke.disco.CapsStorage;
@@ -14,7 +16,7 @@ import com.isode.stroke.vcards.VCardStorage;
public class MemoryStorages implements Storages {
private VCardStorage vcardStorage;
-// private AvatarStorage avatarStorage;
+ private AvatarStorage avatarStorage;
private CapsStorage capsStorage;
private RosterStorage rosterStorage;
// private HistoryStorage historyStorage;
@@ -22,7 +24,7 @@ public class MemoryStorages implements Storages {
public MemoryStorages(CryptoProvider crypto) {
vcardStorage = new VCardMemoryStorage(crypto);
capsStorage = new CapsMemoryStorage();
-// avatarStorage = new AvatarMemoryStorage();
+ avatarStorage = new AvatarMemoryStorage();
rosterStorage = new RosterMemoryStorage();
// #ifdef SWIFT_EXPERIMENTAL_HISTORY
// historyStorage = new SQLiteHistoryStorage(":memory:");
@@ -46,4 +48,9 @@ public class MemoryStorages implements Storages {
return capsStorage;
}
+ @Override
+ public AvatarStorage getAvatarStorage() {
+ return avatarStorage;
+ }
+
}
diff --git a/src/com/isode/stroke/client/Storages.java b/src/com/isode/stroke/client/Storages.java
index 188d1c6..25821e5 100644
--- a/src/com/isode/stroke/client/Storages.java
+++ b/src/com/isode/stroke/client/Storages.java
@@ -4,14 +4,14 @@
*/
package com.isode.stroke.client;
+import com.isode.stroke.avatars.AvatarStorage;
import com.isode.stroke.disco.CapsStorage;
import com.isode.stroke.roster.RosterStorage;
import com.isode.stroke.vcards.VCardStorage;
public interface Storages {
VCardStorage getVCardStorage();
-// AvatarStorage getAvatarStorage();
-// CapsStorage getCapsStorage();
+ AvatarStorage getAvatarStorage();
RosterStorage getRosterStorage();
// HistoryStorage getHistoryStorage();
CapsStorage getCapsStorage();