Fix null cols
This commit is contained in:
@ -261,7 +261,7 @@ public class NostrController : Controller
|
|||||||
var existing = await _db.PushSubscriptions.FirstOrDefaultAsync(a => a.Key == sub.Key);
|
var existing = await _db.PushSubscriptions.FirstOrDefaultAsync(a => a.Key == sub.Key);
|
||||||
if (existing != default)
|
if (existing != default)
|
||||||
{
|
{
|
||||||
return Json(new {id = existing.Id});
|
return Json(new { id = existing.Id });
|
||||||
}
|
}
|
||||||
|
|
||||||
var newId = Guid.NewGuid();
|
var newId = Guid.NewGuid();
|
||||||
@ -292,7 +292,7 @@ public class NostrController : Controller
|
|||||||
|
|
||||||
var sub = await _db.PushSubscriptionTargets
|
var sub = await _db.PushSubscriptionTargets
|
||||||
.Join(_db.PushSubscriptions, a => a.SubscriberPubkey, b => b.Pubkey,
|
.Join(_db.PushSubscriptions, a => a.SubscriberPubkey, b => b.Pubkey,
|
||||||
(a, b) => new {a.SubscriberPubkey, a.TargetPubkey, b.Auth})
|
(a, b) => new { a.SubscriberPubkey, a.TargetPubkey, b.Auth })
|
||||||
.Where(a => a.SubscriberPubkey == userPubkey && a.Auth == auth)
|
.Where(a => a.SubscriberPubkey == userPubkey && a.Auth == auth)
|
||||||
.Select(a => a.TargetPubkey)
|
.Select(a => a.TargetPubkey)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
@ -453,6 +453,8 @@ public class NostrController : Controller
|
|||||||
{
|
{
|
||||||
PubKey = userPubkey,
|
PubKey = userPubkey,
|
||||||
State = UserStreamState.Planned,
|
State = UserStreamState.Planned,
|
||||||
|
EdgeIp = string.Empty,
|
||||||
|
ForwardClientId = string.Empty
|
||||||
};
|
};
|
||||||
newStream.PatchStream(req.Event);
|
newStream.PatchStream(req.Event);
|
||||||
var ev = _eventBuilder.CreateStreamEvent(newStream);
|
var ev = _eventBuilder.CreateStreamEvent(newStream);
|
||||||
@ -494,4 +496,4 @@ public class NostrController : Controller
|
|||||||
var claim = HttpContext.User.Claims.FirstOrDefault(a => a.Type == ClaimTypes.Name);
|
var claim = HttpContext.User.Claims.FirstOrDefault(a => a.Type == ClaimTypes.Name);
|
||||||
return claim!.Value;
|
return claim!.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -54,7 +54,7 @@ public class UserStream
|
|||||||
public string? Thumbnail { get; set; }
|
public string? Thumbnail { get; set; }
|
||||||
|
|
||||||
public Guid? EndpointId { get; set; }
|
public Guid? EndpointId { get; set; }
|
||||||
public IngestEndpoint? Endpoint { get; init; } = null!;
|
public IngestEndpoint? Endpoint { get; init; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Publisher edge IP
|
/// Publisher edge IP
|
||||||
|
Reference in New Issue
Block a user