@@ -49,7 +49,7 @@ - (instancetype)initWithUserId:(NSString *)userId
4949 _desc = desc;
5050 _timeout = timeout;
5151 _isLive = isLive;
52- _assetType = MXEventAssetTypeLiveLocation ;
52+ _assetType = MXEventAssetTypeUser ;
5353 _timestamp = timestamp;
5454 _originalEvent = originalEvent;
5555 }
@@ -91,6 +91,16 @@ - (nullable instancetype)initWithMXEvent:(MXEvent*)event
9191 originalEvent: event];
9292}
9393
94+ - (MXBeaconInfo*)stopped
95+ {
96+ return [[[self class ] alloc ] initWithUserId: self .userId
97+ description: self .desc
98+ timeout: self .timeout
99+ isLive: NO
100+ timestamp: self .timestamp
101+ originalEvent: self .originalEvent];
102+ }
103+
94104#pragma mark - Overrides
95105
96106+ (id )modelFromJSON : (NSDictionary *)jsonDictionary
@@ -112,7 +122,7 @@ + (id)modelFromJSON:(NSDictionary *)jsonDictionary
112122
113123 MXJSONModelSetString (assetTypeString, assetDictionary[kMXMessageContentKeyExtensibleAssetType ]);
114124
115- isAssetTypeValid = [assetTypeString isEqualToString: kMXMessageContentKeyExtensibleAssetTypeLiveLocation ];
125+ isAssetTypeValid = [assetTypeString isEqualToString: kMXMessageContentKeyExtensibleAssetTypeUser ];
116126 }
117127
118128 MXJSONModelSetNumber (timestampNumber, jsonDictionary[kMXMessageContentKeyExtensibleTimestampMSC3488 ])
@@ -134,7 +144,7 @@ + (id)modelFromJSON:(NSDictionary *)jsonDictionary
134144
135145 beaconInfo->_timestamp = [timestampNumber unsignedLongLongValue ];
136146
137- beaconInfo->_assetType = MXEventAssetTypeLiveLocation ;
147+ beaconInfo->_assetType = MXEventAssetTypeUser ;
138148 }
139149
140150 return beaconInfo;
@@ -156,7 +166,7 @@ - (NSDictionary *)JSONDictionary
156166 // Asset type
157167
158168 content[kMXMessageContentKeyExtensibleAssetMSC3488 ] = @{
159- kMXMessageContentKeyExtensibleAssetType : kMXMessageContentKeyExtensibleAssetTypeLiveLocation
169+ kMXMessageContentKeyExtensibleAssetType : kMXMessageContentKeyExtensibleAssetTypeUser
160170 };
161171
162172 return content;
0 commit comments