Skip to content

Commit

Permalink
Started working on messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor W committed Dec 30, 2017
1 parent 9b1fbda commit 02aa22f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Hawkchat/Client/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ private void MainWindow_Load(object sender, EventArgs e)
this.Text = "Hawk Chat";
this.Size = Constants.LARGE_WINDOW;

btnEndConversation.Visible = false;
visualPanel1.Visible = false;
btnReportUser.Visible = false;
btnRequestMore.Visible = false;
btnSendMessage.Visible = false;
btnEndConversation.Visible = true;
visualPanel1.Visible = true;
btnReportUser.Visible = true;
btnRequestMore.Visible = true;
btnSendMessage.Visible = true;

txtMessage.Visible = false;
txtMessage.Visible = true;

this.Update();

Expand Down Expand Up @@ -147,7 +147,7 @@ private void btnSendMessage_Click(object sender, EventArgs e)

dynamic json = new JObject();

json.command = "ESTABLISHCONNECTION";
json.command = "REQUESTCHAT";
json.accountid = toAccountID;

SimpleTCP.Message m = LoginWindow.client.WriteLineAndGetReply(json.ToString(), TimeSpan.FromSeconds(30));
Expand Down
2 changes: 1 addition & 1 deletion Hawkchat/Server/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static async void ParseCommand(string command, Message message, JObject j

break;

case "ESTABLISHCONNECTION":
case "REQUESTCHAT":

string accountID = json["accountid"].ToString();

Expand Down
1 change: 1 addition & 0 deletions Hawkchat/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<Compile Include="enums\ReportCategory.cs" />
<Compile Include="enums\Status.cs" />
<Compile Include="models\ClientModel.cs" />
<Compile Include="models\EstablishedChat.cs" />
<Compile Include="models\UserBan.cs" />
<Compile Include="models\UserReport.cs" />
<Compile Include="Parser.cs" />
Expand Down
20 changes: 20 additions & 0 deletions Hawkchat/Server/models/EstablishedChat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hawkchat.Server.models
{
public class EstablishedChat
{

public int PersonOneAccountID { get; set; }

public int PersonTwoAccountID { get; set; }

public DateTime Established { get; set; }


}
}
1 change: 1 addition & 0 deletions Hawkchat/Server/utils/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class Util
public static Color CYAN = Color.Cyan;

public static List<ClientModel> loggedinUsers = new List<ClientModel>();
public static List<EstablishedChat> establishedChats = new List<EstablishedChat>();

public static void CyanWriteLine(string text)
{
Expand Down

0 comments on commit 02aa22f

Please sign in to comment.