.NET Format Style Fixes
This commit is contained in:
@@ -31,13 +31,17 @@ public class NotificationSendHelper(
|
||||
{
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug($"Send message for {sessionID} started, message: {_jsonUtil.Serialize(notificationMessage)}");
|
||||
_logger.Debug(
|
||||
$"Send message for {sessionID} started, message: {_jsonUtil.Serialize(notificationMessage)}"
|
||||
);
|
||||
}
|
||||
if (_sptWebSocketConnectionHandler.IsWebSocketConnected(sessionID))
|
||||
{
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug($"Send message for {sessionID} websocket available, message being sent");
|
||||
_logger.Debug(
|
||||
$"Send message for {sessionID} websocket available, message being sent"
|
||||
);
|
||||
}
|
||||
_sptWebSocketConnectionHandler.SendMessage(sessionID, notificationMessage);
|
||||
}
|
||||
@@ -45,7 +49,9 @@ public class NotificationSendHelper(
|
||||
{
|
||||
if (_logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
_logger.Debug($"Send message for {sessionID} websocket not available, queuing into profile");
|
||||
_logger.Debug(
|
||||
$"Send message for {sessionID} websocket not available, queuing into profile"
|
||||
);
|
||||
}
|
||||
_notificationService.Add(sessionID, notificationMessage);
|
||||
}
|
||||
@@ -62,7 +68,8 @@ public class NotificationSendHelper(
|
||||
string sessionId,
|
||||
UserDialogInfo senderDetails,
|
||||
string messageText,
|
||||
MessageType messageType)
|
||||
MessageType messageType
|
||||
)
|
||||
{
|
||||
var dialog = GetDialog(sessionId, messageType, senderDetails);
|
||||
|
||||
@@ -76,7 +83,7 @@ public class NotificationSendHelper(
|
||||
Text = messageText,
|
||||
HasRewards = null,
|
||||
RewardCollected = null,
|
||||
Items = null
|
||||
Items = null,
|
||||
};
|
||||
dialog.Messages.Add(message);
|
||||
|
||||
@@ -85,7 +92,7 @@ public class NotificationSendHelper(
|
||||
EventType = NotificationEventType.new_message,
|
||||
EventIdentifier = message.Id,
|
||||
DialogId = message.UserId,
|
||||
Message = message
|
||||
Message = message,
|
||||
};
|
||||
SendMessage(sessionId, notification);
|
||||
}
|
||||
@@ -97,7 +104,11 @@ public class NotificationSendHelper(
|
||||
/// <param name="messageType">Type of message to generate</param>
|
||||
/// <param name="senderDetails">Who is sending the message</param>
|
||||
/// <returns>Dialogue</returns>
|
||||
protected Models.Eft.Profile.Dialogue GetDialog(string sessionId, MessageType messageType, UserDialogInfo senderDetails)
|
||||
protected Models.Eft.Profile.Dialogue GetDialog(
|
||||
string sessionId,
|
||||
MessageType messageType,
|
||||
UserDialogInfo senderDetails
|
||||
)
|
||||
{
|
||||
// Use trader id if sender is trader, otherwise use nickname
|
||||
var dialogKey = senderDetails.Id;
|
||||
@@ -106,12 +117,19 @@ public class NotificationSendHelper(
|
||||
var dialogueData = _saveServer.GetProfile(sessionId).DialogueRecords;
|
||||
|
||||
// Ensure empty dialog exists based on sender details passed in
|
||||
dialogueData.TryAdd(dialogKey, GetEmptyDialogTemplate(dialogKey, messageType, senderDetails));
|
||||
dialogueData.TryAdd(
|
||||
dialogKey,
|
||||
GetEmptyDialogTemplate(dialogKey, messageType, senderDetails)
|
||||
);
|
||||
|
||||
return dialogueData[dialogKey];
|
||||
}
|
||||
|
||||
protected Models.Eft.Profile.Dialogue GetEmptyDialogTemplate(string dialogKey, MessageType messageType, UserDialogInfo senderDetails)
|
||||
protected Models.Eft.Profile.Dialogue GetEmptyDialogTemplate(
|
||||
string dialogKey,
|
||||
MessageType messageType,
|
||||
UserDialogInfo senderDetails
|
||||
)
|
||||
{
|
||||
return new Models.Eft.Profile.Dialogue
|
||||
{
|
||||
@@ -121,7 +139,8 @@ public class NotificationSendHelper(
|
||||
Pinned = false,
|
||||
New = 0,
|
||||
AttachmentsNew = 0,
|
||||
Users = senderDetails.Info.MemberCategory == MemberCategory.Trader ? null : [senderDetails]
|
||||
Users =
|
||||
senderDetails.Info.MemberCategory == MemberCategory.Trader ? null : [senderDetails],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user