Skip to content
This repository was archived by the owner on Dec 7, 2022. It is now read-only.
Open
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
8 changes: 4 additions & 4 deletions Chatbase/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ public async Task<HttpResponseMessage> Send(FBAgentMessageSet set)

private Message setMessageWithClientProperties(Message msg)
{
if (!String.IsNullOrEmpty(api_key)) {
if (!String.IsNullOrWhiteSpace(api_key)) {
msg.api_key = api_key;
}
if (!String.IsNullOrEmpty(user_id)) {
if (!String.IsNullOrWhiteSpace(user_id)) {
msg.user_id = user_id;
}
if (!String.IsNullOrEmpty(platform)) {
if (!String.IsNullOrWhiteSpace(platform)) {
msg.platform = platform;
}
if (!String.IsNullOrEmpty(version)) {
if (!String.IsNullOrWhiteSpace(version)) {
msg.version = version;
}

Expand Down
2 changes: 1 addition & 1 deletion Chatbase/FBAgentMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class FBAgentMessage

public bool RequiredFieldsSet()
{
return !String.IsNullOrEmpty(api_key);
return !String.IsNullOrWhiteSpace(api_key);
}

public FBAgentMessage SetRecipientID(string id)
Expand Down
8 changes: 4 additions & 4 deletions Chatbase/FBUserMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public class FBUserMessage
public bool RequiredFieldsSet()
{
return !(
String.IsNullOrEmpty(sender.id)
|| String.IsNullOrEmpty(recipient.id)
|| String.IsNullOrEmpty(message.mid)
|| String.IsNullOrEmpty(api_key)
String.IsNullOrWhiteSpace(sender.id)
|| String.IsNullOrWhiteSpace(recipient.id)
|| String.IsNullOrWhiteSpace(message.mid)
|| String.IsNullOrWhiteSpace(api_key)
);
}

Expand Down
8 changes: 4 additions & 4 deletions Chatbase/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ public static double CurrentUnixMilliseconds()
public bool RequiredFieldsSet()
{
return !(
String.IsNullOrEmpty(api_key)
|| String.IsNullOrEmpty(type)
|| String.IsNullOrEmpty(user_id)
|| String.IsNullOrEmpty(platform)
String.IsNullOrWhiteSpace(api_key)
|| String.IsNullOrWhiteSpace(type)
|| String.IsNullOrWhiteSpace(user_id)
|| String.IsNullOrWhiteSpace(platform)
);
}

Expand Down