Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal partial class SyncResponseInternalDTO
/// List of events
/// </summary>
[Newtonsoft.Json.JsonProperty("events", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.List<EventInternalDTO> Events { get; set; } = new System.Collections.Generic.List<EventInternalDTO>();
public System.Collections.Generic.List<object> Events { get; set; } = new System.Collections.Generic.List<object>();

/// <summary>
/// List of CIDs that user can't access
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using StreamChat.Core.Helpers;
using StreamChat.Core.InternalDTO.Requests;
using StreamChat.Core.InternalDTO.Responses;
using StreamChat.Core.LowLevelClient.API.Internal;
using StreamChat.Core.LowLevelClient.Models;
Expand Down Expand Up @@ -141,6 +142,12 @@ public Task SendTypingStartEventAsync(string channelType, string channelId)
public Task SendTypingStopEventAsync(string channelType, string channelId)
=> _internalChannelApi.SendTypingStopEventAsync(channelType, channelId);

public async Task<SyncResponse> SyncAsync(SyncRequest syncRequest)
{
var dto = await _internalChannelApi.SyncAsync(syncRequest.TrySaveToDto());
return dto.ToDomain<SyncResponseInternalDTO, SyncResponse>();
}

private readonly IInternalChannelApi _internalChannelApi;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,8 @@ Task<MarkReadResponse> MarkReadAsync(string channelType, string channelId,
Task SendTypingStartEventAsync(string channelType, string channelId);

Task SendTypingStopEventAsync(string channelType, string channelId);

//StreamTodo: perhaps we can skip this declaration and use the Internal one directly
Task<SyncResponse> SyncAsync(SyncRequest syncRequest);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ Task<MarkReadResponseInternalDTO> MarkReadAsync(string channelType, string chann
Task SendTypingStartEventAsync(string channelType, string channelId);

Task SendTypingStopEventAsync(string channelType, string channelId);

Task<SyncResponseInternalDTO> SyncAsync(SyncRequestInternalDTO syncRequest);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,8 @@ public Task SendTypingStopEventAsync(string channelType, string channelId)
{
Type = WSEventType.TypingStop
});

public Task<SyncResponseInternalDTO> SyncAsync(SyncRequestInternalDTO syncRequest)
=> Post<SyncRequestInternalDTO, SyncResponseInternalDTO>($"/sync", syncRequest);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net.Http;
using System.Threading.Tasks;
using System.Threading.Tasks;
using StreamChat.Core.InternalDTO.Requests;
using StreamChat.Core.InternalDTO.Responses;
using StreamChat.Core.Web;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ namespace StreamChat.Core.LowLevelClient.Events
{
public abstract class EventBase
{
public System.DateTimeOffset CreatedAt { get; set; }

private System.Collections.Generic.Dictionary<string, object> _additionalProperties = new System.Collections.Generic.Dictionary<string, object>();

[Newtonsoft.Json.JsonExtensionData]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public sealed class EventChannelDeleted : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public string Team { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public sealed class EventChannelHidden : EventBase,

public bool? ClearHistory { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public string Type { get; set; }

public User User { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public sealed class EventChannelTruncated : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public string Type { get; set; }

EventChannelTruncated ILoadableFrom<ChannelTruncatedEventInternalDTO, EventChannelTruncated>.LoadFromDto(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public sealed class EventChannelUpdated : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Message Message { get; set; }

public string Team { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public sealed class EventChannelVisible : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public string Type { get; set; }

public User User { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ public partial class EventHealthCheck : EventBase, ILoadableFrom<HealthCheckEven
{
public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public OwnUser Me { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public sealed class EventMemberAdded : EventBase, ILoadableFrom<MemberAddedEvent

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Team { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public sealed class EventMemberRemoved : EventBase, ILoadableFrom<MemberRemovedE

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public partial class EventMemberUpdated : EventBase, ILoadableFrom<MemberUpdated

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Team { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public partial class EventMessageDeleted : EventBase, ILoadableFrom<MessageDelet

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public bool? HardDelete { get; set; }

public Message Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ public partial class EventMessageFlagged : EventBase, ILoadableFrom<MessageFlagg
{
public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Flag Flag { get; set; }

public Message Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public class EventMessageNew : EventBase, ILoadableFrom<MessageNewEventInternalD

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Message Message { get; set; }

public string Team { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public partial class EventMessageRead : EventBase, ILoadableFrom<MessageReadEven

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public string Team { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public partial class EventMessageUpdated : EventBase, ILoadableFrom<MessageUpdat

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Message Message { get; set; }

public string Team { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public sealed class EventNotificationAddedToChannel : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public sealed class EventNotificationChannelDeleted : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public string Team { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace StreamChat.Core.LowLevelClient.Events
public partial class EventNotificationChannelMutesUpdated : EventBase,
ILoadableFrom<NotificationChannelMutesUpdatedEventInternalDTO, EventNotificationChannelMutesUpdated>
{
public System.DateTimeOffset? CreatedAt { get; set; }

public OwnUser Me { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public sealed class EventNotificationChannelTruncated : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public string Type { get; set; }

EventNotificationChannelTruncated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public sealed class EventNotificationInviteAccepted : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public sealed class EventNotificationInviteRejected : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public sealed class EventNotificationInvited : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public partial class EventNotificationMarkRead : EventBase, ILoadableFrom<Notifi

public string Cid { get; set; }

public DateTimeOffset? CreatedAt { get; set; }

public string Team { get; set; }

public int? TotalUnreadCount { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public partial class EventNotificationMessageNew : EventBase, ILoadableFrom<Noti

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Message Message { get; set; }

public string Team { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace StreamChat.Core.LowLevelClient.Events
public sealed class EventNotificationMutesUpdated : EventBase,
ILoadableFrom<NotificationMutesUpdatedEventInternalDTO, EventNotificationMutesUpdated>
{
public System.DateTimeOffset? CreatedAt { get; set; }

public OwnUser Me { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public sealed class EventNotificationRemovedFromChannel : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public ChannelMember Member { get; set; }

public string Type { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public class EventReactionDeleted : EventBase, ILoadableFrom<ReactionDeletedEven

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Message Message { get; set; }

public Reaction Reaction { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public class EventReactionNew : EventBase, ILoadableFrom<ReactionNewEventInterna

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Message Message { get; set; }

public Reaction Reaction { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public class EventReactionUpdated : EventBase, ILoadableFrom<ReactionUpdatedEven

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public Message Message { get; set; }

public Reaction Reaction { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public partial class EventTypingStart : EventBase, ILoadableFrom<TypingStartEven

public string Cid { get; set; }

public System.DateTimeOffset CreatedAt { get; set; }

public string ParentId { get; set; }

public string Type { get; internal set; } = WSEventType.TypingStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public partial class EventTypingStop : EventBase, ILoadableFrom<TypingStopEventI

public string Cid { get; set; }

public System.DateTimeOffset CreatedAt { get; set; }

public string ParentId { get; set; }

public string Type { get; internal set; } = WSEventType.TypingStop;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public sealed class EventUserBanned : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public User CreatedBy { get; set; }

public System.DateTimeOffset? Expiration { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace StreamChat.Core.LowLevelClient.Events
public sealed class EventUserDeleted : EventBase,
ILoadableFrom<UserDeletedEventInternalDTO, EventUserDeleted>
{
public System.DateTimeOffset? CreatedAt { get; set; }

public bool? DeleteConversationChannels { get; set; }

public bool? HardDelete { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace StreamChat.Core.LowLevelClient.Events
{
public partial class EventUserFlagged : EventBase, ILoadableFrom<UserFlaggedEventInternalDTO, EventUserFlagged>
{
public System.DateTimeOffset? CreatedAt { get; set; }

public string TargetUser { get; set; }

public System.Collections.Generic.List<string> TargetUsers { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace StreamChat.Core.LowLevelClient.Events
{
public partial class EventUserMuted : EventBase, ILoadableFrom<UserMutedEventInternalDTO, EventUserMuted>
{
public System.DateTimeOffset? CreatedAt { get; set; }

public string TargetUser { get; set; }

public System.Collections.Generic.List<string> TargetUsers { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace StreamChat.Core.LowLevelClient.Events
public sealed class EventUserPresenceChanged : EventBase,
ILoadableFrom<UserPresenceChangedEventInternalDTO, EventUserPresenceChanged>
{
public System.DateTimeOffset? CreatedAt { get; set; }

public string Type { get; set; }

public User User { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public sealed class EventUserUnbanned : EventBase,

public string Cid { get; set; }

public System.DateTimeOffset? CreatedAt { get; set; }

public bool? Shadow { get; set; }

public string Team { get; set; }
Expand Down
Loading