Add one more field to IMEventStateSnapshot
authorChristos KK Loverdos <loverdos@gmail.com>
Thu, 24 May 2012 14:09:45 +0000 (17:09 +0300)
committerChristos KK Loverdos <loverdos@gmail.com>
Thu, 24 May 2012 14:09:45 +0000 (17:09 +0300)
Not sure yet if this will survive.

src/main/scala/gr/grnet/aquarium/computation/data/IMStateSnapshot.scala

index 1b5064c..c0c9c62 100644 (file)
@@ -43,6 +43,10 @@ import gr.grnet.aquarium.event.model.im.IMEventModel
  */
 
 case class IMStateSnapshot(
+                          /**
+                           * True if the user has ever been activated even once.
+                           */
+                           hasBeenActivated: Boolean,
                            /**
                             * This is the latest processed IMEvent
                             */
@@ -63,6 +67,9 @@ case class IMStateSnapshot(
 
 object IMStateSnapshot {
   def initial(imEvent: IMEventModel): IMStateSnapshot = {
-    IMStateSnapshot(imEvent, RoleHistory.initial(imEvent.role, imEvent.occurredMillis))
+    IMStateSnapshot(
+      imEvent.isActive,
+      imEvent,
+      RoleHistory.initial(imEvent.role, imEvent.occurredMillis))
   }
 }