diff --git a/src/MainForm.Designer.cs b/src/MainForm.Designer.cs
index 1c8fcd4..5058503 100644
--- a/src/MainForm.Designer.cs
+++ b/src/MainForm.Designer.cs
@@ -91,9 +91,6 @@
this.devicesTabPage = new System.Windows.Forms.TabPage();
this.devicesPanel = new System.Windows.Forms.Panel();
this.cancelAutoCloseButton1 = new System.Windows.Forms.Button();
- this.devicesListView = new MeshCentralRouter.ListViewExtended();
- this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.stateColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.devicesContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.addMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addRelayMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -141,6 +138,10 @@
this.customAppsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openMapFileDialog = new System.Windows.Forms.OpenFileDialog();
this.saveMapFileDialog = new System.Windows.Forms.SaveFileDialog();
+ this.chatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.devicesListView = new MeshCentralRouter.ListViewExtended();
+ this.nameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.stateColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.panel5.SuspendLayout();
this.mainPanel.SuspendLayout();
this.mainTabControl.SuspendLayout();
@@ -634,37 +635,6 @@
this.cancelAutoCloseButton1.Click += new System.EventHandler(this.cancelAutoCloseButton_Click);
this.cancelAutoCloseButton1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.MainForm_KeyPress);
//
- // devicesListView
- //
- this.devicesListView.BackColor = System.Drawing.SystemColors.Window;
- this.devicesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.nameColumnHeader,
- this.stateColumnHeader});
- this.devicesListView.ContextMenuStrip = this.devicesContextMenuStrip;
- this.devicesListView.FullRowSelect = true;
- this.devicesListView.GridLines = true;
- this.devicesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
- this.devicesListView.HideSelection = false;
- this.devicesListView.LargeImageList = this.devicesImageList;
- resources.ApplyResources(this.devicesListView, "devicesListView");
- this.devicesListView.MultiSelect = false;
- this.devicesListView.Name = "devicesListView";
- this.devicesListView.SmallImageList = this.devicesImageList;
- this.devicesListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
- this.devicesListView.UseCompatibleStateImageBehavior = false;
- this.devicesListView.View = System.Windows.Forms.View.Details;
- this.devicesListView.Click += new System.EventHandler(this.devicesListView_Click);
- this.devicesListView.DoubleClick += new System.EventHandler(this.devicesListView_DoubleClick);
- this.devicesListView.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.MainForm_KeyPress);
- //
- // nameColumnHeader
- //
- resources.ApplyResources(this.nameColumnHeader, "nameColumnHeader");
- //
- // stateColumnHeader
- //
- resources.ApplyResources(this.stateColumnHeader, "stateColumnHeader");
- //
// devicesContextMenuStrip
//
this.devicesContextMenuStrip.ImageScalingSize = new System.Drawing.Size(24, 24);
@@ -679,7 +649,8 @@
this.rdpToolStripMenuItem,
this.sshToolStripMenuItem,
this.scpToolStripMenuItem,
- this.wolToolStripMenuItem});
+ this.wolToolStripMenuItem,
+ this.chatToolStripMenuItem});
this.devicesContextMenuStrip.Name = "devicesContextMenuStrip";
resources.ApplyResources(this.devicesContextMenuStrip, "devicesContextMenuStrip");
this.devicesContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.devicesContextMenuStrip_Opening);
@@ -1007,6 +978,43 @@
this.saveMapFileDialog.DefaultExt = "mcrouter";
resources.ApplyResources(this.saveMapFileDialog, "saveMapFileDialog");
//
+ // chatToolStripMenuItem
+ //
+ this.chatToolStripMenuItem.Name = "chatToolStripMenuItem";
+ resources.ApplyResources(this.chatToolStripMenuItem, "chatToolStripMenuItem");
+ this.chatToolStripMenuItem.Click += new System.EventHandler(this.chatToolStripMenuItem_Click);
+ //
+ // devicesListView
+ //
+ this.devicesListView.BackColor = System.Drawing.SystemColors.Window;
+ this.devicesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.nameColumnHeader,
+ this.stateColumnHeader});
+ this.devicesListView.ContextMenuStrip = this.devicesContextMenuStrip;
+ this.devicesListView.FullRowSelect = true;
+ this.devicesListView.GridLines = true;
+ this.devicesListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
+ this.devicesListView.HideSelection = false;
+ this.devicesListView.LargeImageList = this.devicesImageList;
+ resources.ApplyResources(this.devicesListView, "devicesListView");
+ this.devicesListView.MultiSelect = false;
+ this.devicesListView.Name = "devicesListView";
+ this.devicesListView.SmallImageList = this.devicesImageList;
+ this.devicesListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
+ this.devicesListView.UseCompatibleStateImageBehavior = false;
+ this.devicesListView.View = System.Windows.Forms.View.Details;
+ this.devicesListView.Click += new System.EventHandler(this.devicesListView_Click);
+ this.devicesListView.DoubleClick += new System.EventHandler(this.devicesListView_DoubleClick);
+ this.devicesListView.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.MainForm_KeyPress);
+ //
+ // nameColumnHeader
+ //
+ resources.ApplyResources(this.nameColumnHeader, "nameColumnHeader");
+ //
+ // stateColumnHeader
+ //
+ resources.ApplyResources(this.stateColumnHeader, "stateColumnHeader");
+ //
// MainForm
//
resources.ApplyResources(this, "$this");
@@ -1168,6 +1176,7 @@
private System.Windows.Forms.ToolStripMenuItem customAppsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem customAppsToolStripMenuItem1;
private System.Windows.Forms.Button msgTokenButton;
+ private System.Windows.Forms.ToolStripMenuItem chatToolStripMenuItem;
}
}
diff --git a/src/MainForm.cs b/src/MainForm.cs
index 0c0eced..afefe3c 100644
--- a/src/MainForm.cs
+++ b/src/MainForm.cs
@@ -2115,6 +2115,7 @@ namespace MeshCentralRouter
sshToolStripMenuItem.Visible = false;
scpToolStripMenuItem.Visible = false;
wolToolStripMenuItem.Visible = true; // Wol not allowed for local devices
+ chatToolStripMenuItem.Visible = false;
}
else{ // Agent connected or local device
if (node.agentid < 6)
@@ -2134,6 +2135,7 @@ namespace MeshCentralRouter
addMapToolStripMenuItem.Visible = true;
httpToolStripMenuItem.Visible = true;
httpsToolStripMenuItem.Visible = true;
+ chatToolStripMenuItem.Visible = true;
addRelayMapToolStripMenuItem.Visible = (node.mtype != 3); // Relay mappings are not allowed for local devices
remoteDesktopToolStripMenuItem.Visible = ((node.agentcaps & 1) != 0); // Only display remote desktop if it's supported by the agent (1 = Desktop)
remoteFilesToolStripMenuItem.Visible = ((node.agentcaps & 4) != 0); // Only display remote desktop if it's supported by the agent (4 = Files)
@@ -2428,6 +2430,47 @@ namespace MeshCentralRouter
return r;
}
+ private void chatToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (devicesListView.SelectedItems.Count != 1) { return; }
+ ListViewItem selecteditem = devicesListView.SelectedItems[0];
+ NodeClass node = (NodeClass)selecteditem.Tag;
+ if (((node.conn & 1) == 0) && (node.mtype != 3)) { return; } // Agent not connected on this device & not local device
+ meshcentral.sendCommand("{\"action\":\"meshmessenger\",\"nodeid\":\"" + node.nodeid + "\"}");
+ string url = "https://" + meshcentral.serverinfo["name"];
+ if (meshcentral.serverinfo.TryGetValue("port", out var value1) && value1 is int portNumber && portNumber != 443)
+ {
+ url += ":" + portNumber;
+ }
+ if (meshcentral.serverinfo.TryGetValue("domainsuffix", out var value) && value is string domainSuffix && !string.IsNullOrEmpty(domainSuffix))
+ {
+ url += "/" + domainSuffix;
+ }
+ url += "/messenger?id=meshmessenger/" + Uri.EscapeDataString(node.nodeid) + "/" + Uri.EscapeDataString(meshcentral.userid) + "&title=" + node.name;
+ if ((meshcentral.authCookie != null) && (meshcentral.authCookie != "")) { url += "&auth=" + meshcentral.authCookie; }
+ try
+ {
+ if (meshcentral.debug) { try { File.AppendAllText("debug.log", "Opening chat window locally using ProcessStartInfo\r\n"); } catch (Exception) { } }
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = url,
+ UseShellExecute = true
+ });
+ }
+ catch (Exception)
+ {
+ try
+ {
+ if (meshcentral.debug) { try { File.AppendAllText("debug.log", "Opening chat window locally using cmd\r\n"); } catch (Exception) { } }
+ Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
+ }
+ catch (Exception)
+ {
+ if (meshcentral.debug) { try { File.AppendAllText("debug.log", "Failed to open chat window locally\r\n"); } catch (Exception) { } }
+ }
+ }
+ }
+
/*
private delegate void displayMessageHandler(string msg, int buttons, string extra, int progress);
private void displayMessage(string msg, int buttons = 0, string extra = "", int progress = 0)
diff --git a/src/MainForm.resx b/src/MainForm.resx
index c4635b2..50e7e8f 100644
--- a/src/MainForm.resx
+++ b/src/MainForm.resx
@@ -1474,7 +1474,7 @@
NoControl
- 6, 180
+ 6, 176
168, 35
@@ -1519,19 +1519,19 @@
Segoe UI, 9pt, style=Bold
- 170, 22
+ 180, 22
Add &Map...
- 170, 22
+ 180, 22
Add &Relay Map...
- 167, 6
+ 177, 6
171, 22
@@ -1552,55 +1552,61 @@
Privacy Bar
- 170, 22
+ 180, 22
Remote Desktop...
- 170, 22
+ 180, 22
Remote Files...
- 170, 22
+ 180, 22
HTTP
- 170, 22
+ 180, 22
HTTPS
- 170, 22
+ 180, 22
RDP
- 170, 22
+ 180, 22
SSH
- 170, 22
+ 180, 22
SCP
- 170, 22
+ 180, 22
Wake Up...
+
+ 180, 22
+
+
+ Chat
+
- 171, 230
+ 181, 274
devicesContextMenuStrip
@@ -1616,7 +1622,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADg
- HQAAAk1TRnQBSQFMAgEBEAEAATABAQEwAQEBEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA
+ HQAAAk1TRnQBSQFMAgEBEAEAAUABAQFAAQEBEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABUAMAAQEBAAEYBgABPP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AJYAA/0D+AP3A/sD/yEAA/0D+gP5
A/wD/xgAAfoB+wH6A/4qAAP9A/8tAAP7A88D1QPbA88D1AO+A9QYAAP8A90D4APjA90D4APUA+MSAAP8
AZEBjwF9AU4BaAEhAfQB9QH0JAAD/gPRA8YD+ioAAcYCxwHPAtAB2ALZA90DywPBA68DmgP3FQAD2APd
@@ -1762,7 +1768,7 @@
devicesListView
- MeshCentralRouter.ListViewExtended, MeshCentralRouter, Version=1.8.8680.22147, Culture=neutral, PublicKeyToken=null
+ MeshCentralRouter.ListViewExtended, MeshCentralRouter, Version=1.8.8984.19540, Culture=neutral, PublicKeyToken=null
devicesPanel
@@ -1783,7 +1789,7 @@
2, 88
- 362, 52
+ 358, 52
5
@@ -1822,7 +1828,7 @@
2, 88
- 362, 52
+ 358, 52
4
@@ -1900,7 +1906,7 @@
NoControl
- 4, 182
+ 4, 179
168, 35
@@ -1945,7 +1951,7 @@
6, 79
- 436, 52
+ 430, 52
4
@@ -1974,7 +1980,7 @@ Click "Add" to get started.
0, 0
- 472, 221
+ 470, 218
49
@@ -1998,7 +2004,7 @@ Click "Add" to get started.
NoControl
- 1, 226
+ 1, 223
20, 20
@@ -2025,7 +2031,7 @@ Click "Add" to get started.
NoControl
- 240, 226
+ 238, 223
20, 20
@@ -2055,7 +2061,7 @@ Click "Add" to get started.
NoControl
- 372, 223
+ 370, 220
100, 23
@@ -2088,7 +2094,7 @@ Click "Add" to get started.
NoControl
- 266, 223
+ 264, 220
100, 23
@@ -2118,7 +2124,7 @@ Click "Add" to get started.
3, 3, 3, 3
- 472, 253
+ 470, 250
1
@@ -5934,6 +5940,9 @@ Click "Add" to get started.
AADAPwAAwD8AAMA/AADAPwAA
+
+ NoControl
+
MeshCentral Router
@@ -5985,18 +5994,6 @@ Click "Add" to get started.
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- nameColumnHeader
-
-
- System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- stateColumnHeader
-
-
- System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
addMapToolStripMenuItem
@@ -6171,6 +6168,24 @@ Click "Add" to get started.
System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ chatToolStripMenuItem
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ nameColumnHeader
+
+
+ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ stateColumnHeader
+
+
+ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
MainForm