├── .gitattributes ├── .gitignore ├── ConnectivityWebService.NETCore ├── .config │ └── dotnet-tools.json ├── ConnectivityWebService.NETCore.csproj ├── Program.cs ├── Properties │ ├── PublishProfiles │ │ └── FolderProfile.pubxml │ └── launchSettings.json ├── Startup.cs ├── appsettings.Development.json ├── appsettings.json └── systemd.service ├── LICENSE ├── Mesh.sln ├── MeshApp ├── MeshApp.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Resources │ ├── Attachment.png │ ├── FullNetwork.png │ ├── MessageNotification.wav │ ├── NoNetwork.png │ ├── PartialNetwork.png │ ├── change-photo.png │ ├── double-ticks.png │ ├── logo2.ico │ ├── message-failed.png │ ├── point-left.png │ ├── point-right.png │ ├── send message.png │ ├── single-tick.png │ └── waiting.png ├── UserControls │ ├── ChatListItem.Designer.cs │ ├── ChatListItem.cs │ ├── ChatListItem.resx │ ├── ChatMessageFileItem.Designer.cs │ ├── ChatMessageFileItem.cs │ ├── ChatMessageFileItem.resx │ ├── ChatMessageInfoItem.Designer.cs │ ├── ChatMessageInfoItem.cs │ ├── ChatMessageInfoItem.resx │ ├── ChatMessageTextItem.Designer.cs │ ├── ChatMessageTextItem.cs │ ├── ChatMessageTextItem.resx │ ├── ChatMessageView.Designer.cs │ ├── ChatMessageView.cs │ ├── ChatMessageView.resx │ ├── CustomButton.cs │ ├── CustomListView.Designer.cs │ ├── CustomListView.cs │ ├── CustomListView.resx │ ├── CustomListViewItem.Designer.cs │ ├── CustomListViewItem.cs │ ├── CustomListViewItem.resx │ ├── CustomListViewPanel.Designer.cs │ ├── CustomListViewPanel.cs │ ├── CustomListViewPanel.resx │ ├── CustomPanel.Designer.cs │ ├── CustomPanel.cs │ ├── CustomPanel.resx │ ├── IChatMessageItem.cs │ ├── MeshNetworkPanel.Designer.cs │ ├── MeshNetworkPanel.cs │ ├── MeshNetworkPanel.resx │ ├── UserListItem.Designer.cs │ ├── UserListItem.cs │ └── UserListItem.resx ├── app.config ├── app.manifest ├── frmAbout.Designer.cs ├── frmAbout.cs ├── frmAbout.resx ├── frmAddGroupChat.Designer.cs ├── frmAddGroupChat.cs ├── frmAddGroupChat.resx ├── frmAddPrivateChat.Designer.cs ├── frmAddPrivateChat.cs ├── frmAddPrivateChat.resx ├── frmChatProperties.Designer.cs ├── frmChatProperties.cs ├── frmChatProperties.resx ├── frmCreateProfile.Designer.cs ├── frmCreateProfile.cs ├── frmCreateProfile.resx ├── frmEditProfile.Designer.cs ├── frmEditProfile.cs ├── frmEditProfile.resx ├── frmForwardToNetwork.Designer.cs ├── frmForwardToNetwork.cs ├── frmForwardToNetwork.resx ├── frmImageDialog.Designer.cs ├── frmImageDialog.cs ├── frmImageDialog.resx ├── frmImportPEM.Designer.cs ├── frmImportPEM.cs ├── frmImportPEM.resx ├── frmMain.Designer.cs ├── frmMain.cs ├── frmMain.resx ├── frmMessageInfo.Designer.cs ├── frmMessageInfo.cs ├── frmMessageInfo.resx ├── frmNetworkInfo.Designer.cs ├── frmNetworkInfo.cs ├── frmNetworkInfo.resx ├── frmProfileManager.Designer.cs ├── frmProfileManager.cs ├── frmProfileManager.resx ├── frmProxyConfig.Designer.cs ├── frmProxyConfig.cs ├── frmProxyConfig.resx ├── frmSettings.Designer.cs ├── frmSettings.cs ├── frmSettings.resx ├── frmViewGroup.Designer.cs ├── frmViewGroup.cs ├── frmViewGroup.resx ├── frmViewProfile.Designer.cs ├── frmViewProfile.cs ├── frmViewProfile.resx ├── frmViewUserDetails.Designer.cs ├── frmViewUserDetails.cs ├── frmViewUserDetails.resx └── logo2.ico ├── MeshCore ├── Debug.cs ├── IDebug.cs ├── MeshCore.csproj ├── MeshException.cs ├── MeshNode.cs ├── MeshUpdate.cs ├── Message │ ├── MessageItem.cs │ ├── MessageRecipient.cs │ └── MessageStore.cs ├── Network │ ├── Connections │ │ ├── Connection.cs │ │ └── ConnectionManager.cs │ ├── DHT │ │ ├── DhtManager.cs │ │ ├── DhtNode.cs │ │ ├── DhtRpcPacket.cs │ │ ├── IDhtConnectionManager.cs │ │ ├── KBucket.cs │ │ └── NodeContact.cs │ ├── MeshNetwork.cs │ ├── MeshNetworkPacket.cs │ ├── MeshNetworkPeerInfo.cs │ └── SecureChannel │ │ ├── SecureChannelClientStream.cs │ │ ├── SecureChannelException.cs │ │ ├── SecureChannelHandshakePacket.cs │ │ ├── SecureChannelServerStream.cs │ │ └── SecureChannelStream.cs └── Properties │ └── AssemblyInfo.cs ├── MeshSetup └── MeshSetup.vdproj └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc 262 | 263 | MeshApp/tor/ -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "3.1.0", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/ConnectivityWebService.NETCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp3.1 5 | InProcess 6 | 1.1 7 | Shreyas Zare 8 | Technitium 9 | Technitium Mesh Connectivity Web Service 10 | Copyright (C) 2019 Technitium 11 | 12 | 13 | 14 | 15 | ..\..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.dll 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/Program.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using Microsoft.AspNetCore; 21 | using Microsoft.AspNetCore.Hosting; 22 | 23 | namespace ConnectivityWebService.NETCore 24 | { 25 | public class Program 26 | { 27 | public static void Main(string[] args) 28 | { 29 | CreateWebHostBuilder(args).Build().Run(); 30 | } 31 | 32 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 33 | WebHost.CreateDefaultBuilder(args) 34 | .UseStartup(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | FileSystem 9 | FileSystem 10 | Release 11 | Any CPU 12 | 13 | True 14 | False 15 | netcoreapp3.1 16 | 19c011ee-4db3-406b-a2c1-7a13d7ed8f5f 17 | false 18 | bin\Release\netcoreapp3.1\publish\ 19 | True 20 | 21 | -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:50571", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "ConnectivityWebService.NETCore": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | }, 7 | "AllowedHosts": "*" 8 | } 9 | -------------------------------------------------------------------------------- /ConnectivityWebService.NETCore/systemd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Technitium Mesh Connectivity Web Service 3 | 4 | [Service] 5 | WorkingDirectory=/var/www/ipv4.mesh.im 6 | ExecStart=/usr/bin/dotnet /var/www/ipv4.mesh.im/ConnectivityWebService.NETCore.dll --server.urls http://localhost:8003/ 7 | Restart=always 8 | # Restart service after 10 seconds if the dotnet service crashes: 9 | RestartSec=10 10 | KillSignal=SIGINT 11 | SyslogIdentifier=dotnet-mesh 12 | User=www-data 13 | Environment=ASPNETCORE_ENVIRONMENT=Production 14 | Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /Mesh.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29123.88 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeshApp", "MeshApp\MeshApp.csproj", "{68ED49DF-C976-4165-9314-EA15C4FAB1A3}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConnectivityWebService.NETCore", "ConnectivityWebService.NETCore\ConnectivityWebService.NETCore.csproj", "{19C011EE-4DB3-406B-A2C1-7A13D7ED8F5F}" 9 | EndProject 10 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "MeshSetup", "MeshSetup\MeshSetup.vdproj", "{C7B0615D-0DBC-4887-8098-B9845C99C267}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeshCore", "MeshCore\MeshCore.csproj", "{D6B9A05E-7417-4902-8B41-114CD0A8130E}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {68ED49DF-C976-4165-9314-EA15C4FAB1A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {68ED49DF-C976-4165-9314-EA15C4FAB1A3}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {68ED49DF-C976-4165-9314-EA15C4FAB1A3}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {68ED49DF-C976-4165-9314-EA15C4FAB1A3}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {19C011EE-4DB3-406B-A2C1-7A13D7ED8F5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {19C011EE-4DB3-406B-A2C1-7A13D7ED8F5F}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {19C011EE-4DB3-406B-A2C1-7A13D7ED8F5F}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {19C011EE-4DB3-406B-A2C1-7A13D7ED8F5F}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {C7B0615D-0DBC-4887-8098-B9845C99C267}.Debug|Any CPU.ActiveCfg = Debug 29 | {C7B0615D-0DBC-4887-8098-B9845C99C267}.Release|Any CPU.ActiveCfg = Release 30 | {D6B9A05E-7417-4902-8B41-114CD0A8130E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {D6B9A05E-7417-4902-8B41-114CD0A8130E}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {D6B9A05E-7417-4902-8B41-114CD0A8130E}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {D6B9A05E-7417-4902-8B41-114CD0A8130E}.Release|Any CPU.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | GlobalSection(ExtensibilityGlobals) = postSolution 39 | SolutionGuid = {985FCB3A-EC5C-43BD-9D0C-8C818E86B419} 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /MeshApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mesh App")] 9 | [assembly: AssemblyDescription("A secure, anonymous, peer-to-peer instant messenger.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Technitium")] 12 | [assembly: AssemblyProduct("Mesh")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("de6e050c-beb4-4c19-b756-3622511a9dc1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.1.0.0")] 36 | [assembly: AssemblyFileVersion("1.1.0.0")] 37 | -------------------------------------------------------------------------------- /MeshApp/Resources/Attachment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/Attachment.png -------------------------------------------------------------------------------- /MeshApp/Resources/FullNetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/FullNetwork.png -------------------------------------------------------------------------------- /MeshApp/Resources/MessageNotification.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/MessageNotification.wav -------------------------------------------------------------------------------- /MeshApp/Resources/NoNetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/NoNetwork.png -------------------------------------------------------------------------------- /MeshApp/Resources/PartialNetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/PartialNetwork.png -------------------------------------------------------------------------------- /MeshApp/Resources/change-photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/change-photo.png -------------------------------------------------------------------------------- /MeshApp/Resources/double-ticks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/double-ticks.png -------------------------------------------------------------------------------- /MeshApp/Resources/logo2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/logo2.ico -------------------------------------------------------------------------------- /MeshApp/Resources/message-failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/message-failed.png -------------------------------------------------------------------------------- /MeshApp/Resources/point-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/point-left.png -------------------------------------------------------------------------------- /MeshApp/Resources/point-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/point-right.png -------------------------------------------------------------------------------- /MeshApp/Resources/send message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/send message.png -------------------------------------------------------------------------------- /MeshApp/Resources/single-tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/single-tick.png -------------------------------------------------------------------------------- /MeshApp/Resources/waiting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/Resources/waiting.png -------------------------------------------------------------------------------- /MeshApp/UserControls/ChatMessageInfoItem.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp.UserControls 2 | { 3 | partial class ChatMessageInfoItem 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); 34 | this.copyInfoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 35 | this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); 36 | this.contextMenuStrip1.SuspendLayout(); 37 | this.SuspendLayout(); 38 | // 39 | // label1 40 | // 41 | this.label1.AutoEllipsis = true; 42 | this.label1.AutoSize = true; 43 | this.label1.BackColor = System.Drawing.Color.Azure; 44 | this.label1.ContextMenuStrip = this.contextMenuStrip1; 45 | this.label1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 46 | this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); 47 | this.label1.Location = new System.Drawing.Point(0, 6); 48 | this.label1.Name = "label1"; 49 | this.label1.Padding = new System.Windows.Forms.Padding(3); 50 | this.label1.Size = new System.Drawing.Size(116, 20); 51 | this.label1.TabIndex = 0; 52 | this.label1.Text = "Sample Info Message"; 53 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 54 | // 55 | // contextMenuStrip1 56 | // 57 | this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 58 | this.copyInfoToolStripMenuItem}); 59 | this.contextMenuStrip1.Name = "contextMenuStrip1"; 60 | this.contextMenuStrip1.Size = new System.Drawing.Size(127, 26); 61 | // 62 | // copyInfoToolStripMenuItem 63 | // 64 | this.copyInfoToolStripMenuItem.Name = "copyInfoToolStripMenuItem"; 65 | this.copyInfoToolStripMenuItem.Size = new System.Drawing.Size(126, 22); 66 | this.copyInfoToolStripMenuItem.Text = "Copy Info"; 67 | this.copyInfoToolStripMenuItem.Click += new System.EventHandler(this.copyInfoToolStripMenuItem_Click); 68 | // 69 | // ChatMessageInfoItem 70 | // 71 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 72 | this.BackColor = System.Drawing.Color.Transparent; 73 | this.ContextMenuStrip = this.contextMenuStrip1; 74 | this.Controls.Add(this.label1); 75 | this.Name = "ChatMessageInfoItem"; 76 | this.Size = new System.Drawing.Size(600, 32); 77 | this.contextMenuStrip1.ResumeLayout(false); 78 | this.ResumeLayout(false); 79 | this.PerformLayout(); 80 | 81 | } 82 | 83 | #endregion 84 | 85 | private System.Windows.Forms.Label label1; 86 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; 87 | private System.Windows.Forms.ToolStripMenuItem copyInfoToolStripMenuItem; 88 | private System.Windows.Forms.ToolTip toolTip1; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /MeshApp/UserControls/ChatMessageInfoItem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using MeshCore.Message; 21 | using System; 22 | using System.Drawing; 23 | using System.Windows.Forms; 24 | 25 | namespace MeshApp.UserControls 26 | { 27 | public partial class ChatMessageInfoItem : CustomListViewItem, IChatMessageItem 28 | { 29 | #region variables 30 | 31 | MessageItem _message; 32 | 33 | #endregion 34 | 35 | #region constructor 36 | 37 | public ChatMessageInfoItem(MessageItem message) 38 | { 39 | InitializeComponent(); 40 | 41 | _message = message; 42 | 43 | if (string.IsNullOrEmpty(_message.MessageText)) 44 | { 45 | label1.Text = _message.MessageDate.ToLocalTime().ToString("dddd, MMMM d, yyyy"); 46 | } 47 | else 48 | { 49 | label1.Text = _message.MessageText; 50 | toolTip1.SetToolTip(label1, _message.MessageDate.ToLocalTime().ToString()); 51 | } 52 | 53 | OnResize(EventArgs.Empty); 54 | } 55 | 56 | #endregion 57 | 58 | #region form code 59 | 60 | protected override void OnResize(EventArgs e) 61 | { 62 | base.OnResize(e); 63 | 64 | if (label1 != null) 65 | { 66 | this.SuspendLayout(); 67 | 68 | if (label1.Width > (this.Width - 4)) 69 | { 70 | label1.AutoSize = false; 71 | label1.Left = 2; 72 | label1.Width = this.Width - 4; 73 | 74 | Size msgSize = TextRenderer.MeasureText(label1.Text, label1.Font, new Size(label1.Width - 3 - 3, int.MaxValue), TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl); 75 | 76 | label1.Height = msgSize.Height + 3 + 3; 77 | this.Height = label1.Height + 6 + 6; 78 | } 79 | else if (label1.Width < (this.Width - 4)) 80 | { 81 | label1.AutoSize = true; 82 | label1.Left = (this.Width - label1.Width) / 2; 83 | } 84 | 85 | this.ResumeLayout(); 86 | } 87 | 88 | this.Refresh(); 89 | } 90 | 91 | private void copyInfoToolStripMenuItem_Click(object sender, EventArgs e) 92 | { 93 | try 94 | { 95 | if (string.IsNullOrEmpty(_message.MessageText)) 96 | Clipboard.SetText(label1.Text); 97 | else 98 | Clipboard.SetText("[" + _message.MessageDate.ToString("d MMM, yyyy HH:mm:ss") + "] " + label1.Text); 99 | } 100 | catch 101 | { } 102 | } 103 | 104 | public void DeliveryNotification(MessageItem msg) 105 | { 106 | //do nothing 107 | } 108 | 109 | #endregion 110 | 111 | #region properties 112 | 113 | public MessageItem Message 114 | { get { return _message; } } 115 | 116 | #endregion 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /MeshApp/UserControls/ChatMessageInfoItem.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | 17, 17 125 | 126 | 127 | 172, 17 128 | 129 | 130 | True 131 | 132 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomButton.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Drawing; 23 | using System.Text; 24 | using System.Windows.Forms; 25 | 26 | namespace MeshApp.UserControls 27 | { 28 | public class CustomButton : PictureBox 29 | { 30 | #region variables 31 | 32 | Image _image; 33 | 34 | #endregion 35 | 36 | #region constructor 37 | 38 | public CustomButton() 39 | : base() 40 | { 41 | this.SizeMode = PictureBoxSizeMode.AutoSize; 42 | } 43 | 44 | #endregion 45 | 46 | #region protected 47 | 48 | protected override void OnCreateControl() 49 | { 50 | base.OnCreateControl(); 51 | 52 | _image = this.Image; 53 | } 54 | 55 | protected override void OnMouseEnter(EventArgs e) 56 | { 57 | base.OnMouseEnter(e); 58 | 59 | base.Image = this.ImageHover; 60 | } 61 | 62 | protected override void OnMouseLeave(EventArgs e) 63 | { 64 | base.OnMouseLeave(e); 65 | 66 | this.Image = _image; 67 | } 68 | 69 | protected override void OnMouseDown(MouseEventArgs e) 70 | { 71 | base.OnMouseDown(e); 72 | 73 | this.Image = this.ImageMouseDown; 74 | } 75 | 76 | protected override void OnMouseUp(MouseEventArgs e) 77 | { 78 | base.OnMouseUp(e); 79 | 80 | this.Image = _image; 81 | } 82 | 83 | #endregion 84 | 85 | #region properties 86 | 87 | public Image ImageHover 88 | { get; set; } 89 | 90 | public Image ImageMouseDown 91 | { get; set; } 92 | 93 | #endregion 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListView.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp.UserControls 2 | { 3 | partial class CustomListView 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // CustomListView 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.AutoScroll = true; 38 | this.BackColor = System.Drawing.Color.White; 39 | this.Name = "CustomListView"; 40 | this.Size = new System.Drawing.Size(262, 257); 41 | this.ResumeLayout(false); 42 | 43 | } 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListView.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListViewItem.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp.UserControls 2 | { 3 | partial class CustomListViewItem 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // CustomListViewItem 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.Name = "CustomListViewItem"; 38 | this.Size = new System.Drawing.Size(167, 77); 39 | this.Load += new System.EventHandler(this.CustomListViewItem_Load); 40 | this.ResumeLayout(false); 41 | 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListViewItem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Drawing; 22 | using System.Windows.Forms; 23 | 24 | namespace MeshApp.UserControls 25 | { 26 | public partial class CustomListViewItem : UserControl 27 | { 28 | #region event 29 | 30 | public event EventHandler SortList; 31 | 32 | #endregion 33 | 34 | #region variables 35 | 36 | const int BORDER_SIZE = 1; 37 | 38 | bool _selected = false; 39 | 40 | #endregion 41 | 42 | #region constructor 43 | 44 | public CustomListViewItem() 45 | { 46 | InitializeComponent(); 47 | } 48 | 49 | #endregion 50 | 51 | #region private 52 | 53 | private void CustomListViewItem_Load(object sender, EventArgs e) 54 | { 55 | foreach (Control ctrl in Controls) 56 | { 57 | ctrl.Click += ctrl_Click; 58 | ctrl.DoubleClick += ctrl_DoubleClick; 59 | ctrl.MouseUp += ctrl_MouseUp; 60 | ctrl.MouseLeave += ctrl_MouseLeave; 61 | ctrl.MouseEnter += ctrl_MouseEnter; 62 | ctrl.KeyDown += ctrl_KeyDown; 63 | ctrl.KeyUp += ctrl_KeyUp; 64 | ctrl.KeyPress += ctrl_KeyPress; 65 | } 66 | } 67 | 68 | private void ctrl_Click(object sender, EventArgs e) 69 | { 70 | OnClick(EventArgs.Empty); 71 | } 72 | 73 | private void ctrl_DoubleClick(object sender, EventArgs e) 74 | { 75 | OnDoubleClick(EventArgs.Empty); 76 | } 77 | 78 | private void ctrl_MouseUp(object sender, MouseEventArgs e) 79 | { 80 | if (sender != this) 81 | { 82 | Control obj = sender as Control; 83 | e = new MouseEventArgs(e.Button, e.Clicks, obj.Location.X + e.X, obj.Location.Y + e.Y, e.Delta); 84 | } 85 | 86 | OnMouseUp(e); 87 | } 88 | 89 | private void ctrl_MouseEnter(object sender, EventArgs e) 90 | { 91 | OnMouseEnter(e); 92 | } 93 | 94 | private void ctrl_MouseLeave(object sender, EventArgs e) 95 | { 96 | OnMouseLeave(e); 97 | } 98 | 99 | private void ctrl_KeyPress(object sender, KeyPressEventArgs e) 100 | { 101 | OnKeyPress(e); 102 | } 103 | 104 | private void ctrl_KeyUp(object sender, KeyEventArgs e) 105 | { 106 | OnKeyUp(e); 107 | } 108 | 109 | private void ctrl_KeyDown(object sender, KeyEventArgs e) 110 | { 111 | OnKeyDown(e); 112 | } 113 | 114 | #endregion 115 | 116 | #region protected 117 | 118 | protected virtual void OnSelected() 119 | { } 120 | 121 | protected virtual void OnMouseOver(bool hovering) 122 | { } 123 | 124 | protected override void OnPaint(PaintEventArgs e) 125 | { 126 | base.OnPaint(e); 127 | 128 | ControlPaint.DrawBorder(e.Graphics, ClientRectangle, 129 | SeparatorColor, 0, ButtonBorderStyle.Solid, 130 | SeparatorColor, 0, ButtonBorderStyle.Solid, 131 | SeparatorColor, 0, ButtonBorderStyle.Solid, 132 | SeparatorColor, BORDER_SIZE, ButtonBorderStyle.Solid); 133 | } 134 | 135 | protected override void OnMouseEnter(EventArgs e) 136 | { 137 | if (this.ClientRectangle.Contains(this.PointToClient(Control.MousePosition))) 138 | { 139 | base.OnMouseEnter(e); 140 | OnMouseOver(true); 141 | } 142 | } 143 | 144 | protected override void OnMouseLeave(EventArgs e) 145 | { 146 | if (!this.ClientRectangle.Contains(this.PointToClient(Control.MousePosition))) 147 | { 148 | base.OnMouseLeave(e); 149 | OnMouseOver(false); 150 | } 151 | } 152 | 153 | protected void SortListView() 154 | { 155 | if (SortList != null) 156 | SortList(this, EventArgs.Empty); 157 | } 158 | 159 | public virtual bool AllowTriming() 160 | { 161 | return true; 162 | } 163 | 164 | #endregion 165 | 166 | #region properties 167 | 168 | public Color SeparatorColor 169 | { set; get; } 170 | 171 | public bool Selected 172 | { 173 | get { return _selected; } 174 | set 175 | { 176 | if (_selected != value) 177 | { 178 | _selected = value; 179 | 180 | this.SuspendLayout(); 181 | 182 | OnSelected(); 183 | 184 | this.ResumeLayout(); 185 | } 186 | } 187 | } 188 | 189 | #endregion 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListViewItem.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListViewPanel.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp.UserControls 2 | { 3 | partial class CustomListViewPanel 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.customListView1 = new MeshApp.UserControls.CustomListView(); 32 | this.panel2.SuspendLayout(); 33 | this.SuspendLayout(); 34 | // 35 | // panel2 36 | // 37 | this.panel2.Controls.Add(this.customListView1); 38 | // 39 | // customListView1 40 | // 41 | this.customListView1.AutoScroll = true; 42 | this.customListView1.AutoScrollToBottom = false; 43 | this.customListView1.BackColor = System.Drawing.Color.White; 44 | this.customListView1.BorderColor = System.Drawing.Color.Empty; 45 | this.customListView1.Dock = System.Windows.Forms.DockStyle.Fill; 46 | this.customListView1.Location = new System.Drawing.Point(0, 0); 47 | this.customListView1.Name = "customListView1"; 48 | this.customListView1.SeparatorColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(223))))); 49 | this.customListView1.Size = new System.Drawing.Size(297, 121); 50 | this.customListView1.TabIndex = 4; 51 | this.customListView1.ItemClick += new System.EventHandler(this.customListView1_ItemClick); 52 | this.customListView1.ItemDoubleClick += new System.EventHandler(this.customListView1_ItemDoubleClick); 53 | this.customListView1.ItemMouseUp += new System.Windows.Forms.MouseEventHandler(this.customListView1_ItemMouseUp); 54 | this.customListView1.ItemKeyDown += new System.Windows.Forms.KeyEventHandler(this.customListView1_ItemKeyDown); 55 | this.customListView1.ItemKeyUp += new System.Windows.Forms.KeyEventHandler(this.customListView1_ItemKeyUp); 56 | this.customListView1.ItemKeyPress += new System.Windows.Forms.KeyPressEventHandler(this.customListView1_ItemKeyPress); 57 | // 58 | // CustomListView2 59 | // 60 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 61 | this.Name = "CustomListView2"; 62 | this.panel2.ResumeLayout(false); 63 | this.ResumeLayout(false); 64 | 65 | } 66 | 67 | #endregion 68 | 69 | private CustomListView customListView1; 70 | 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListViewPanel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Windows.Forms; 22 | 23 | namespace MeshApp.UserControls 24 | { 25 | public partial class CustomListViewPanel : CustomPanel 26 | { 27 | #region events 28 | 29 | public event EventHandler ItemClick; 30 | public event EventHandler ItemDoubleClick; 31 | public event MouseEventHandler ItemMouseUp; 32 | public event KeyEventHandler ItemKeyDown; 33 | public event KeyEventHandler ItemKeyUp; 34 | public event KeyPressEventHandler ItemKeyPress; 35 | 36 | #endregion 37 | 38 | #region constructor 39 | 40 | public CustomListViewPanel() 41 | { 42 | InitializeComponent(); 43 | } 44 | 45 | #endregion 46 | 47 | #region public 48 | 49 | public CustomListViewItem AddItem(CustomListViewItem item) 50 | { 51 | return customListView1.AddItem(item); 52 | } 53 | 54 | public bool RemoveItem(CustomListViewItem item) 55 | { 56 | return customListView1.RemoveItem(item); 57 | } 58 | 59 | public void RemoveAllItems() 60 | { 61 | customListView1.RemoveAllItems(); 62 | } 63 | 64 | #endregion 65 | 66 | #region private 67 | 68 | private void customListView1_ItemClick(object sender, EventArgs e) 69 | { 70 | if (ItemClick != null) 71 | ItemClick(sender, e); 72 | } 73 | 74 | private void customListView1_ItemDoubleClick(object sender, EventArgs e) 75 | { 76 | if (ItemDoubleClick != null) 77 | ItemDoubleClick(sender, e); 78 | } 79 | 80 | private void customListView1_ItemKeyDown(object sender, KeyEventArgs e) 81 | { 82 | if (ItemKeyDown != null) 83 | ItemKeyDown(sender, e); 84 | } 85 | 86 | private void customListView1_ItemKeyPress(object sender, KeyPressEventArgs e) 87 | { 88 | if (ItemKeyPress != null) 89 | ItemKeyPress(sender, e); 90 | } 91 | 92 | private void customListView1_ItemKeyUp(object sender, KeyEventArgs e) 93 | { 94 | if (ItemKeyUp != null) 95 | ItemKeyUp(sender, e); 96 | } 97 | 98 | private void customListView1_ItemMouseUp(object sender, MouseEventArgs e) 99 | { 100 | if (ItemMouseUp != null) 101 | ItemMouseUp(sender, e); 102 | } 103 | 104 | #endregion 105 | 106 | #region properties 107 | 108 | public CustomListViewItem SelectedItem 109 | { get { return customListView1.SelectedItem; } } 110 | 111 | public int SeperatorSize 112 | { 113 | get { return customListView1.Padding.Top; } 114 | set { customListView1.Padding = new Padding(value, value, value, 0); } 115 | } 116 | 117 | public ControlCollection Items 118 | { get { return customListView1.Controls; } } 119 | 120 | public bool SortItems 121 | { 122 | get { return customListView1.SortItems; } 123 | set { customListView1.SortItems = value; } 124 | } 125 | 126 | #endregion 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomListViewPanel.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomPanel.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp.UserControls 2 | { 3 | partial class CustomPanel 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.panel1 = new System.Windows.Forms.Panel(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.panel2 = new System.Windows.Forms.Panel(); 34 | this.panel1.SuspendLayout(); 35 | this.SuspendLayout(); 36 | // 37 | // panel1 38 | // 39 | this.panel1.BackColor = System.Drawing.Color.WhiteSmoke; 40 | this.panel1.Controls.Add(this.label1); 41 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top; 42 | this.panel1.Location = new System.Drawing.Point(1, 1); 43 | this.panel1.Name = "panel1"; 44 | this.panel1.Size = new System.Drawing.Size(297, 25); 45 | this.panel1.TabIndex = 2; 46 | // 47 | // label1 48 | // 49 | this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 50 | | System.Windows.Forms.AnchorStyles.Right))); 51 | this.label1.AutoEllipsis = true; 52 | this.label1.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 53 | this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(67)))), ((int)(((byte)(74)))), ((int)(((byte)(84))))); 54 | this.label1.Location = new System.Drawing.Point(5, 2); 55 | this.label1.Name = "label1"; 56 | this.label1.Size = new System.Drawing.Size(287, 21); 57 | this.label1.TabIndex = 2; 58 | this.label1.Text = "Title"; 59 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 60 | // 61 | // panel2 62 | // 63 | this.panel2.BackColor = System.Drawing.Color.White; 64 | this.panel2.Location = new System.Drawing.Point(1, 27); 65 | this.panel2.Name = "panel2"; 66 | this.panel2.Size = new System.Drawing.Size(297, 121); 67 | this.panel2.TabIndex = 3; 68 | // 69 | // CustomPanel 70 | // 71 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 72 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 73 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(223))))); 74 | this.Controls.Add(this.panel2); 75 | this.Controls.Add(this.panel1); 76 | this.Name = "CustomPanel"; 77 | this.Padding = new System.Windows.Forms.Padding(1, 1, 2, 2); 78 | this.Size = new System.Drawing.Size(300, 150); 79 | this.panel1.ResumeLayout(false); 80 | this.ResumeLayout(false); 81 | 82 | } 83 | 84 | #endregion 85 | 86 | private System.Windows.Forms.Panel panel1; 87 | private System.Windows.Forms.Label label1; 88 | protected System.Windows.Forms.Panel panel2; 89 | 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomPanel.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.ComponentModel; 23 | using System.Drawing; 24 | using System.Text; 25 | using System.Windows.Forms; 26 | using System.ComponentModel.Design; 27 | 28 | namespace MeshApp.UserControls 29 | { 30 | [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] 31 | public partial class CustomPanel : UserControl 32 | { 33 | #region variables 34 | 35 | const int BORDER_SIZE = 1; 36 | 37 | Color BorderColor = Color.FromArgb(224, 224, 223); 38 | Color BorderColorShadow = Color.FromArgb(199, 199, 198); 39 | 40 | #endregion 41 | 42 | #region constructor 43 | 44 | public CustomPanel() 45 | { 46 | InitializeComponent(); 47 | } 48 | 49 | #endregion 50 | 51 | #region private 52 | 53 | protected override void OnPaint(PaintEventArgs e) 54 | { 55 | base.OnPaint(e); 56 | 57 | ControlPaint.DrawBorder(e.Graphics, ClientRectangle, 58 | BorderColor, 0, ButtonBorderStyle.Solid, 59 | BorderColor, 0, ButtonBorderStyle.Solid, 60 | BorderColorShadow, BORDER_SIZE * 2, ButtonBorderStyle.Solid, 61 | BorderColorShadow, BORDER_SIZE * 2, ButtonBorderStyle.Solid); 62 | 63 | ControlPaint.DrawBorder(e.Graphics, ClientRectangle, 64 | BorderColor, BORDER_SIZE, ButtonBorderStyle.Solid, 65 | BorderColor, BORDER_SIZE, ButtonBorderStyle.Solid, 66 | BorderColor, BORDER_SIZE, ButtonBorderStyle.Solid, 67 | BorderColor, BORDER_SIZE, ButtonBorderStyle.Solid); 68 | } 69 | 70 | protected override void OnResize(EventArgs e) 71 | { 72 | if (panel1.Height == 0) 73 | panel2.Size = new Size(this.Width - 1 - 2, this.Height - 1 - 2); 74 | else 75 | panel2.Size = new Size(this.Width - 1 - 2, this.Height - panel1.Height - 1 - 1 - 2); 76 | 77 | base.OnResize(e); 78 | 79 | this.Refresh(); 80 | } 81 | 82 | #endregion 83 | 84 | #region properties 85 | 86 | public string Title 87 | { 88 | get 89 | { return label1.Text; } 90 | set 91 | { 92 | label1.Text = value; 93 | 94 | if (string.IsNullOrEmpty(value)) 95 | { 96 | panel1.Height = 0; 97 | panel2.Location = new Point(1, 1); 98 | } 99 | else 100 | { 101 | panel1.Height = 25; 102 | panel2.Location = new Point(1, 1 + 25 + 1); 103 | } 104 | } 105 | } 106 | 107 | #endregion 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /MeshApp/UserControls/CustomPanel.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | -------------------------------------------------------------------------------- /MeshApp/UserControls/IChatMessageItem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using MeshCore.Message; 21 | 22 | namespace MeshApp.UserControls 23 | { 24 | interface IChatMessageItem 25 | { 26 | void DeliveryNotification(MessageItem msg); 27 | MessageItem Message { get; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MeshApp/UserControls/MeshNetworkPanel.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp.UserControls 2 | { 3 | partial class MeshNetworkPanel 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.meshPanelSplitContainer = new System.Windows.Forms.SplitContainer(); 33 | this.lstUsers = new MeshApp.UserControls.CustomListViewPanel(); 34 | this.mnuUserList = new System.Windows.Forms.ContextMenuStrip(this.components); 35 | this.mnuViewUserProfile = new System.Windows.Forms.ToolStripMenuItem(); 36 | ((System.ComponentModel.ISupportInitialize)(this.meshPanelSplitContainer)).BeginInit(); 37 | this.meshPanelSplitContainer.Panel2.SuspendLayout(); 38 | this.meshPanelSplitContainer.SuspendLayout(); 39 | this.mnuUserList.SuspendLayout(); 40 | this.SuspendLayout(); 41 | // 42 | // meshPanelSplitContainer 43 | // 44 | this.meshPanelSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; 45 | this.meshPanelSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; 46 | this.meshPanelSplitContainer.Location = new System.Drawing.Point(0, 0); 47 | this.meshPanelSplitContainer.Name = "meshPanelSplitContainer"; 48 | // 49 | // meshPanelSplitContainer.Panel1 50 | // 51 | this.meshPanelSplitContainer.Panel1.BackColor = System.Drawing.Color.Transparent; 52 | this.meshPanelSplitContainer.Panel1.Padding = new System.Windows.Forms.Padding(3, 6, 2, 6); 53 | // 54 | // meshPanelSplitContainer.Panel2 55 | // 56 | this.meshPanelSplitContainer.Panel2.Controls.Add(this.lstUsers); 57 | this.meshPanelSplitContainer.Panel2.Padding = new System.Windows.Forms.Padding(3, 6, 6, 6); 58 | this.meshPanelSplitContainer.Panel2MinSize = 100; 59 | this.meshPanelSplitContainer.Size = new System.Drawing.Size(738, 431); 60 | this.meshPanelSplitContainer.SplitterDistance = 498; 61 | this.meshPanelSplitContainer.SplitterWidth = 2; 62 | this.meshPanelSplitContainer.TabIndex = 12; 63 | this.meshPanelSplitContainer.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.SplitContainer_SplitterMoved); 64 | // 65 | // lstUsers 66 | // 67 | this.lstUsers.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(223))))); 68 | this.lstUsers.Dock = System.Windows.Forms.DockStyle.Fill; 69 | this.lstUsers.Location = new System.Drawing.Point(3, 6); 70 | this.lstUsers.Name = "lstUsers"; 71 | this.lstUsers.Padding = new System.Windows.Forms.Padding(1, 1, 2, 2); 72 | this.lstUsers.SeperatorSize = 0; 73 | this.lstUsers.Size = new System.Drawing.Size(229, 419); 74 | this.lstUsers.SortItems = true; 75 | this.lstUsers.TabIndex = 1; 76 | this.lstUsers.Title = "People"; 77 | this.lstUsers.ItemMouseUp += new System.Windows.Forms.MouseEventHandler(this.lstUsers_ItemMouseUp); 78 | // 79 | // mnuUserList 80 | // 81 | this.mnuUserList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 82 | this.mnuViewUserProfile}); 83 | this.mnuUserList.Name = "mnuUserList"; 84 | this.mnuUserList.Size = new System.Drawing.Size(181, 48); 85 | // 86 | // mnuViewUserProfile 87 | // 88 | this.mnuViewUserProfile.Name = "mnuViewUserProfile"; 89 | this.mnuViewUserProfile.Size = new System.Drawing.Size(180, 22); 90 | this.mnuViewUserProfile.Text = "&View Profile"; 91 | this.mnuViewUserProfile.Click += new System.EventHandler(this.mnuViewUserProfile_Click); 92 | // 93 | // MeshNetworkPanel 94 | // 95 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 96 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 97 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(232)))), ((int)(((byte)(232))))); 98 | this.Controls.Add(this.meshPanelSplitContainer); 99 | this.Name = "MeshNetworkPanel"; 100 | this.Size = new System.Drawing.Size(738, 431); 101 | this.meshPanelSplitContainer.Panel2.ResumeLayout(false); 102 | ((System.ComponentModel.ISupportInitialize)(this.meshPanelSplitContainer)).EndInit(); 103 | this.meshPanelSplitContainer.ResumeLayout(false); 104 | this.mnuUserList.ResumeLayout(false); 105 | this.ResumeLayout(false); 106 | 107 | } 108 | 109 | #endregion 110 | 111 | private System.Windows.Forms.SplitContainer meshPanelSplitContainer; 112 | private System.Windows.Forms.ContextMenuStrip mnuUserList; 113 | private System.Windows.Forms.ToolStripMenuItem mnuViewUserProfile; 114 | private CustomListViewPanel lstUsers; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /MeshApp/UserControls/MeshNetworkPanel.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /MeshApp/UserControls/UserListItem.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp.UserControls 2 | { 3 | partial class UserListItem 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.labStatusMessage = new System.Windows.Forms.Label(); 32 | this.labName = new System.Windows.Forms.Label(); 33 | this.labIcon = new System.Windows.Forms.Label(); 34 | this.picIcon = new System.Windows.Forms.PictureBox(); 35 | ((System.ComponentModel.ISupportInitialize)(this.picIcon)).BeginInit(); 36 | this.SuspendLayout(); 37 | // 38 | // labStatusMessage 39 | // 40 | this.labStatusMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); 41 | this.labStatusMessage.AutoEllipsis = true; 42 | this.labStatusMessage.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 43 | this.labStatusMessage.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); 44 | this.labStatusMessage.Location = new System.Drawing.Point(54, 31); 45 | this.labStatusMessage.Name = "labStatusMessage"; 46 | this.labStatusMessage.Size = new System.Drawing.Size(163, 15); 47 | this.labStatusMessage.TabIndex = 2; 48 | this.labStatusMessage.Text = "Push the limits!"; 49 | this.labStatusMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 50 | // 51 | // labName 52 | // 53 | this.labName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); 54 | this.labName.AutoEllipsis = true; 55 | this.labName.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 56 | this.labName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); 57 | this.labName.Location = new System.Drawing.Point(53, 7); 58 | this.labName.Name = "labName"; 59 | this.labName.Size = new System.Drawing.Size(164, 22); 60 | this.labName.TabIndex = 1; 61 | this.labName.Text = "Shreyas Zare"; 62 | this.labName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 63 | // 64 | // labIcon 65 | // 66 | this.labIcon.BackColor = System.Drawing.Color.Gray; 67 | this.labIcon.Font = new System.Drawing.Font("Arial", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 68 | this.labIcon.ForeColor = System.Drawing.Color.White; 69 | this.labIcon.Location = new System.Drawing.Point(3, 3); 70 | this.labIcon.Name = "labIcon"; 71 | this.labIcon.Size = new System.Drawing.Size(48, 48); 72 | this.labIcon.TabIndex = 0; 73 | this.labIcon.Text = "SZ"; 74 | this.labIcon.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 75 | // 76 | // picIcon 77 | // 78 | this.picIcon.Location = new System.Drawing.Point(3, 3); 79 | this.picIcon.Name = "picIcon"; 80 | this.picIcon.Size = new System.Drawing.Size(48, 48); 81 | this.picIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 82 | this.picIcon.TabIndex = 4; 83 | this.picIcon.TabStop = false; 84 | this.picIcon.Visible = false; 85 | // 86 | // UserListItem 87 | // 88 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 89 | this.BackColor = System.Drawing.Color.Gainsboro; 90 | this.Controls.Add(this.labStatusMessage); 91 | this.Controls.Add(this.labName); 92 | this.Controls.Add(this.labIcon); 93 | this.Controls.Add(this.picIcon); 94 | this.ForeColor = System.Drawing.Color.White; 95 | this.Name = "UserListItem"; 96 | this.Size = new System.Drawing.Size(220, 55); 97 | ((System.ComponentModel.ISupportInitialize)(this.picIcon)).EndInit(); 98 | this.ResumeLayout(false); 99 | 100 | } 101 | 102 | #endregion 103 | 104 | private System.Windows.Forms.Label labIcon; 105 | private System.Windows.Forms.Label labName; 106 | private System.Windows.Forms.Label labStatusMessage; 107 | private System.Windows.Forms.PictureBox picIcon; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /MeshApp/UserControls/UserListItem.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using MeshCore.Network; 21 | using System; 22 | using System.Drawing; 23 | using System.IO; 24 | 25 | namespace MeshApp.UserControls 26 | { 27 | public partial class UserListItem : CustomListViewItem 28 | { 29 | #region variables 30 | 31 | MeshNetwork.Peer _peer; 32 | 33 | #endregion 34 | 35 | #region constructor 36 | 37 | public UserListItem(MeshNetwork.Peer peer) 38 | { 39 | InitializeComponent(); 40 | 41 | _peer = peer; 42 | 43 | RefreshIcon(); 44 | RefreshText(); 45 | RefreshView(); 46 | 47 | _peer.StateChanged += peer_StateChanged; 48 | _peer.ConnectivityStatusChanged += peer_ConnectivityStatusChanged; 49 | _peer.ProfileChanged += peer_ProfileChanged; 50 | } 51 | 52 | #endregion 53 | 54 | #region private 55 | 56 | private void RefreshIcon() 57 | { 58 | if (_peer.IsOnline) 59 | { 60 | byte[] image = _peer.ProfileDisplayImage; 61 | 62 | if ((image == null) || (image.Length == 0)) 63 | { 64 | labIcon.BackColor = Color.FromArgb(102, 153, 255); 65 | 66 | labIcon.Visible = true; 67 | picIcon.Visible = false; 68 | } 69 | else 70 | { 71 | using (MemoryStream mS = new MemoryStream(image)) 72 | { 73 | picIcon.Image = new Bitmap(Image.FromStream(mS), picIcon.Size); 74 | } 75 | 76 | labIcon.Visible = false; 77 | picIcon.Visible = true; 78 | } 79 | } 80 | else 81 | { 82 | labIcon.BackColor = Color.Gray; 83 | 84 | labIcon.Visible = true; 85 | picIcon.Visible = false; 86 | } 87 | } 88 | 89 | private void RefreshText() 90 | { 91 | string name = _peer.ProfileDisplayName; 92 | 93 | if (name.Length > 0) 94 | { 95 | labIcon.Text = name.Substring(0, 1).ToUpper(); 96 | 97 | int x = name.LastIndexOf(" ", StringComparison.CurrentCultureIgnoreCase); 98 | if (x > 0) 99 | { 100 | labIcon.Text += name.Substring(x + 1, 1).ToUpper(); 101 | } 102 | else if (name.Length > 1) 103 | { 104 | labIcon.Text += name.Substring(1, 1).ToLower(); 105 | } 106 | } 107 | else 108 | { 109 | labIcon.Text = ""; 110 | } 111 | 112 | labName.Text = name; 113 | labStatusMessage.Text = _peer.ProfileStatusMessage; 114 | } 115 | 116 | private void RefreshView() 117 | { 118 | if (_peer.IsOnline) 119 | { 120 | switch (_peer.ConnectivityStatus) 121 | { 122 | case MeshNetwork.PeerConnectivityStatus.FullMeshNetwork: 123 | this.BackColor = Color.White; 124 | break; 125 | 126 | case MeshNetwork.PeerConnectivityStatus.PartialMeshNetwork: 127 | this.BackColor = Color.Orange; 128 | break; 129 | 130 | default: 131 | this.BackColor = Color.Gainsboro; 132 | break; 133 | } 134 | } 135 | else 136 | { 137 | this.BackColor = Color.Gainsboro; 138 | } 139 | } 140 | 141 | private void peer_StateChanged(object sender, EventArgs e) 142 | { 143 | RefreshIcon(); 144 | SortListView(); 145 | } 146 | 147 | private void peer_ProfileChanged(object sender, EventArgs e) 148 | { 149 | RefreshText(); 150 | RefreshIcon(); 151 | } 152 | 153 | private void peer_ConnectivityStatusChanged(object sender, EventArgs e) 154 | { 155 | RefreshView(); 156 | } 157 | 158 | #endregion 159 | 160 | #region protected 161 | 162 | protected override void OnMouseOver(bool hovering) 163 | { 164 | if (hovering) 165 | this.BackColor = Color.FromArgb(241, 245, 249); 166 | else 167 | RefreshView(); 168 | } 169 | 170 | #endregion 171 | 172 | #region public 173 | 174 | public override string ToString() 175 | { 176 | string prepend; 177 | 178 | if (_peer.IsSelfPeer) 179 | prepend = "0"; 180 | else if (_peer.IsOnline) 181 | prepend = "1"; 182 | else 183 | prepend = "2"; 184 | 185 | return prepend + _peer.ProfileDisplayName; 186 | } 187 | 188 | #endregion 189 | 190 | #region property 191 | 192 | public MeshNetwork.Peer Peer 193 | { get { return _peer; } } 194 | 195 | #endregion 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /MeshApp/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /MeshApp/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 59 | 60 | 61 | 62 | 63 | 64 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /MeshApp/frmAbout.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System.Windows.Forms; 21 | 22 | namespace MeshApp 23 | { 24 | public partial class frmAbout : Form 25 | { 26 | public frmAbout() 27 | { 28 | InitializeComponent(); 29 | 30 | labVersion.Text = "version " + Application.ProductVersion + " (alpha)"; 31 | } 32 | 33 | private void lnkTerms_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 34 | { 35 | System.Diagnostics.Process.Start(@"http://go.technitium.com/?id=31"); 36 | } 37 | 38 | private void lnkContactEmail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 39 | { 40 | System.Diagnostics.Process.Start(@"mailto:support@mesh.im"); 41 | } 42 | 43 | private void lnkWebsite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 44 | { 45 | System.Diagnostics.Process.Start(@"https://mesh.im/"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /MeshApp/frmAddGroupChat.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Windows.Forms; 22 | 23 | namespace MeshApp 24 | { 25 | public partial class frmAddGroupChat : Form 26 | { 27 | #region constructor 28 | 29 | public frmAddGroupChat() 30 | { 31 | InitializeComponent(); 32 | } 33 | 34 | #endregion 35 | 36 | #region form code 37 | 38 | private void btnAdd_Click(object sender, EventArgs e) 39 | { 40 | txtNetworkName.Text = txtNetworkName.Text.Trim(); 41 | 42 | if (string.IsNullOrEmpty(txtNetworkName.Text)) 43 | { 44 | MessageBox.Show("Please enter a valid group name.", "Invalid Group Name", MessageBoxButtons.OK, MessageBoxIcon.Error); 45 | return; 46 | } 47 | 48 | this.DialogResult = DialogResult.OK; 49 | this.Close(); 50 | } 51 | 52 | #endregion 53 | 54 | #region properties 55 | 56 | public string NetworkName 57 | { get { return txtNetworkName.Text; } } 58 | 59 | public string SharedSecret 60 | { get { return txtPassword.Text; } } 61 | 62 | public bool LocalNetworkOnly 63 | { get { return chkLocalNetworkOnly.Checked; } } 64 | 65 | #endregion 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /MeshApp/frmAddPrivateChat.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Windows.Forms; 22 | using TechnitiumLibrary.IO; 23 | 24 | namespace MeshApp 25 | { 26 | public partial class frmAddPrivateChat : Form 27 | { 28 | #region constructor 29 | 30 | public frmAddPrivateChat() 31 | { 32 | InitializeComponent(); 33 | } 34 | 35 | #endregion 36 | 37 | #region form code 38 | 39 | private void btnAdd_Click(object sender, EventArgs e) 40 | { 41 | txtPeerUserId.Text = txtPeerUserId.Text.Trim(); 42 | 43 | if (string.IsNullOrEmpty(txtPeerUserId.Text) || (txtPeerUserId.Text.Length != 40)) 44 | { 45 | MessageBox.Show("Please enter a valid User ID of your peer to chat with.", "Invalid User ID", MessageBoxButtons.OK, MessageBoxIcon.Error); 46 | return; 47 | } 48 | 49 | txtPeerDisplayName.Text = txtPeerDisplayName.Text.Trim(); 50 | 51 | if (string.IsNullOrEmpty(txtPeerDisplayName.Text)) 52 | { 53 | MessageBox.Show("Please enter a name for the peer to display.", "Missing Peer Name", MessageBoxButtons.OK, MessageBoxIcon.Error); 54 | return; 55 | } 56 | 57 | if (string.IsNullOrEmpty(txtInvitationMessage.Text)) 58 | { 59 | MessageBox.Show("Please enter an invitation message for the new private chat.", "Missing Invitation Message", MessageBoxButtons.OK, MessageBoxIcon.Error); 60 | return; 61 | } 62 | 63 | this.DialogResult = DialogResult.OK; 64 | this.Close(); 65 | } 66 | 67 | #endregion 68 | 69 | #region properties 70 | 71 | public BinaryNumber PeerUserId 72 | { get { return BinaryNumber.Parse(txtPeerUserId.Text); } } 73 | 74 | public string PeerDisplayName 75 | { get { return txtPeerDisplayName.Text; } } 76 | 77 | public bool LocalNetworkOnly 78 | { get { return chkLocalNetworkOnly.Checked; } } 79 | 80 | public string InvitationMessage 81 | { get { return txtInvitationMessage.Text; } } 82 | 83 | #endregion 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /MeshApp/frmForwardToNetwork.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp 2 | { 3 | partial class frmForwardToNetwork 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.btnOK = new System.Windows.Forms.Button(); 34 | this.btnCancel = new System.Windows.Forms.Button(); 35 | this.SuspendLayout(); 36 | // 37 | // checkedListBox1 38 | // 39 | this.checkedListBox1.CheckOnClick = true; 40 | this.checkedListBox1.FormattingEnabled = true; 41 | this.checkedListBox1.IntegralHeight = false; 42 | this.checkedListBox1.Location = new System.Drawing.Point(12, 31); 43 | this.checkedListBox1.Name = "checkedListBox1"; 44 | this.checkedListBox1.Size = new System.Drawing.Size(260, 243); 45 | this.checkedListBox1.Sorted = true; 46 | this.checkedListBox1.TabIndex = 0; 47 | // 48 | // label1 49 | // 50 | this.label1.Location = new System.Drawing.Point(9, 11); 51 | this.label1.Name = "label1"; 52 | this.label1.Size = new System.Drawing.Size(260, 15); 53 | this.label1.TabIndex = 1; 54 | this.label1.Text = "Select the chats below to forward the message:"; 55 | // 56 | // btnOK 57 | // 58 | this.btnOK.Location = new System.Drawing.Point(116, 280); 59 | this.btnOK.Name = "btnOK"; 60 | this.btnOK.Size = new System.Drawing.Size(75, 23); 61 | this.btnOK.TabIndex = 2; 62 | this.btnOK.Text = "OK"; 63 | this.btnOK.UseVisualStyleBackColor = true; 64 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click); 65 | // 66 | // btnCancel 67 | // 68 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 69 | this.btnCancel.Location = new System.Drawing.Point(197, 280); 70 | this.btnCancel.Name = "btnCancel"; 71 | this.btnCancel.Size = new System.Drawing.Size(75, 23); 72 | this.btnCancel.TabIndex = 3; 73 | this.btnCancel.Text = "Cancel"; 74 | this.btnCancel.UseVisualStyleBackColor = true; 75 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 76 | // 77 | // frmForwardToNetwork 78 | // 79 | this.AcceptButton = this.btnOK; 80 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 81 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 82 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250))))); 83 | this.CancelButton = this.btnCancel; 84 | this.ClientSize = new System.Drawing.Size(284, 311); 85 | this.Controls.Add(this.btnCancel); 86 | this.Controls.Add(this.btnOK); 87 | this.Controls.Add(this.label1); 88 | this.Controls.Add(this.checkedListBox1); 89 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 90 | this.MaximizeBox = false; 91 | this.MinimizeBox = false; 92 | this.Name = "frmForwardToNetwork"; 93 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 94 | this.Text = "Forward To"; 95 | this.ResumeLayout(false); 96 | 97 | } 98 | 99 | #endregion 100 | 101 | private System.Windows.Forms.CheckedListBox checkedListBox1; 102 | private System.Windows.Forms.Label label1; 103 | private System.Windows.Forms.Button btnOK; 104 | private System.Windows.Forms.Button btnCancel; 105 | } 106 | } -------------------------------------------------------------------------------- /MeshApp/frmForwardToNetwork.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using MeshCore; 21 | using MeshCore.Network; 22 | using System; 23 | using System.Collections.Generic; 24 | using System.Windows.Forms; 25 | 26 | namespace MeshApp 27 | { 28 | public partial class frmForwardToNetwork : Form 29 | { 30 | List _selectedNetworks; 31 | 32 | public frmForwardToNetwork(MeshNode node) 33 | { 34 | InitializeComponent(); 35 | 36 | foreach (MeshNetwork networks in node.GetNetworks()) 37 | checkedListBox1.Items.Add(networks); 38 | } 39 | 40 | private void btnOK_Click(object sender, EventArgs e) 41 | { 42 | _selectedNetworks = new List(); 43 | 44 | foreach (MeshNetwork network in checkedListBox1.CheckedItems) 45 | _selectedNetworks.Add(network); 46 | 47 | DialogResult = DialogResult.OK; 48 | this.Close(); 49 | } 50 | 51 | private void btnCancel_Click(object sender, EventArgs e) 52 | { 53 | DialogResult = DialogResult.Cancel; 54 | this.Close(); 55 | } 56 | 57 | public List SelectedNetworks 58 | { get { return _selectedNetworks; } } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /MeshApp/frmForwardToNetwork.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | 133 | True 134 | 135 | -------------------------------------------------------------------------------- /MeshApp/frmImageDialog.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp 2 | { 3 | partial class frmImageDialog 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.picImage = new System.Windows.Forms.PictureBox(); 32 | this.btnBrowse = new System.Windows.Forms.Button(); 33 | this.btnOK = new System.Windows.Forms.Button(); 34 | this.btnCancel = new System.Windows.Forms.Button(); 35 | this.label1 = new System.Windows.Forms.Label(); 36 | ((System.ComponentModel.ISupportInitialize)(this.picImage)).BeginInit(); 37 | this.SuspendLayout(); 38 | // 39 | // picImage 40 | // 41 | this.picImage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 42 | | System.Windows.Forms.AnchorStyles.Left) 43 | | System.Windows.Forms.AnchorStyles.Right))); 44 | this.picImage.BackColor = System.Drawing.Color.Silver; 45 | this.picImage.Cursor = System.Windows.Forms.Cursors.Cross; 46 | this.picImage.Location = new System.Drawing.Point(12, 27); 47 | this.picImage.Margin = new System.Windows.Forms.Padding(0); 48 | this.picImage.Name = "picImage"; 49 | this.picImage.Size = new System.Drawing.Size(600, 280); 50 | this.picImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; 51 | this.picImage.TabIndex = 0; 52 | this.picImage.TabStop = false; 53 | this.picImage.MouseDown += new System.Windows.Forms.MouseEventHandler(this.picImage_MouseDown); 54 | this.picImage.MouseMove += new System.Windows.Forms.MouseEventHandler(this.picImage_MouseMove); 55 | this.picImage.MouseUp += new System.Windows.Forms.MouseEventHandler(this.picImage_MouseUp); 56 | // 57 | // btnBrowse 58 | // 59 | this.btnBrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 60 | this.btnBrowse.Location = new System.Drawing.Point(12, 313); 61 | this.btnBrowse.Name = "btnBrowse"; 62 | this.btnBrowse.Size = new System.Drawing.Size(75, 23); 63 | this.btnBrowse.TabIndex = 1; 64 | this.btnBrowse.Text = "Browse"; 65 | this.btnBrowse.UseVisualStyleBackColor = true; 66 | this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); 67 | // 68 | // btnOK 69 | // 70 | this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 71 | this.btnOK.Enabled = false; 72 | this.btnOK.Location = new System.Drawing.Point(456, 313); 73 | this.btnOK.Name = "btnOK"; 74 | this.btnOK.Size = new System.Drawing.Size(75, 23); 75 | this.btnOK.TabIndex = 3; 76 | this.btnOK.Text = "OK"; 77 | this.btnOK.UseVisualStyleBackColor = true; 78 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click); 79 | // 80 | // btnCancel 81 | // 82 | this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 83 | this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; 84 | this.btnCancel.Location = new System.Drawing.Point(537, 313); 85 | this.btnCancel.Name = "btnCancel"; 86 | this.btnCancel.Size = new System.Drawing.Size(75, 23); 87 | this.btnCancel.TabIndex = 4; 88 | this.btnCancel.Text = "Cancel"; 89 | this.btnCancel.UseVisualStyleBackColor = true; 90 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); 91 | // 92 | // label1 93 | // 94 | this.label1.AutoSize = true; 95 | this.label1.Location = new System.Drawing.Point(9, 9); 96 | this.label1.Name = "label1"; 97 | this.label1.Size = new System.Drawing.Size(377, 13); 98 | this.label1.TabIndex = 5; 99 | this.label1.Text = "To select profile picture, use your mouse to drag and crop image shown below."; 100 | // 101 | // frmImageDialog 102 | // 103 | this.AcceptButton = this.btnOK; 104 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 105 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 106 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250))))); 107 | this.CancelButton = this.btnCancel; 108 | this.ClientSize = new System.Drawing.Size(624, 343); 109 | this.Controls.Add(this.label1); 110 | this.Controls.Add(this.btnCancel); 111 | this.Controls.Add(this.btnOK); 112 | this.Controls.Add(this.btnBrowse); 113 | this.Controls.Add(this.picImage); 114 | this.MinimizeBox = false; 115 | this.Name = "frmImageDialog"; 116 | this.ShowIcon = false; 117 | this.ShowInTaskbar = false; 118 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 119 | this.Text = "Select Profile Picture"; 120 | this.Load += new System.EventHandler(this.frmImageDialog_Load); 121 | ((System.ComponentModel.ISupportInitialize)(this.picImage)).EndInit(); 122 | this.ResumeLayout(false); 123 | this.PerformLayout(); 124 | 125 | } 126 | 127 | #endregion 128 | 129 | private System.Windows.Forms.PictureBox picImage; 130 | private System.Windows.Forms.Button btnBrowse; 131 | private System.Windows.Forms.Button btnOK; 132 | private System.Windows.Forms.Button btnCancel; 133 | private System.Windows.Forms.Label label1; 134 | } 135 | } -------------------------------------------------------------------------------- /MeshApp/frmImportPEM.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Security.Cryptography; 23 | using System.Text; 24 | using System.Windows.Forms; 25 | using TechnitiumLibrary.Security.Cryptography; 26 | 27 | namespace MeshApp 28 | { 29 | public partial class frmImportPEM : Form 30 | { 31 | #region variables 32 | 33 | RSAParameters _privateKey; 34 | 35 | #endregion 36 | 37 | #region form code 38 | 39 | public frmImportPEM() 40 | { 41 | InitializeComponent(); 42 | } 43 | 44 | private void txtRSAKey_TextChanged(object sender, EventArgs e) 45 | { 46 | if (!txtRSAKey.Text.Contains("\r\n")) 47 | txtRSAKey.Text = txtRSAKey.Text.Replace("\n", "\r\n"); 48 | } 49 | 50 | private void btnOK_Click(object sender, EventArgs e) 51 | { 52 | try 53 | { 54 | using (MemoryStream mS = new MemoryStream(Encoding.UTF8.GetBytes(txtRSAKey.Text))) 55 | { 56 | _privateKey = PEMFormat.ReadRSAPrivateKey(mS); 57 | } 58 | 59 | using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) 60 | { 61 | rsa.ImportParameters(_privateKey); 62 | 63 | if (rsa.KeySize < 2048) 64 | { 65 | MessageBox.Show("The RSA private key must be at least 2048-bit. The current key is " + rsa.KeySize + "-bit.", "Short RSA Private Key", MessageBoxButtons.OK, MessageBoxIcon.Error); 66 | return; 67 | } 68 | } 69 | 70 | this.DialogResult = DialogResult.OK; 71 | this.Close(); 72 | } 73 | catch 74 | { 75 | MessageBox.Show("Error in reading PEM format. Please make sure you have pasted the RSA private key in a proper PEM format.", "Invalid PEM Format", MessageBoxButtons.OK, MessageBoxIcon.Error); 76 | } 77 | } 78 | 79 | #endregion 80 | 81 | #region properties 82 | 83 | public RSAParameters PrivateKey 84 | { get { return _privateKey; } } 85 | 86 | #endregion 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /MeshApp/frmMessageInfo.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp 2 | { 3 | partial class frmMessageInfo 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.chatMessagePanel = new System.Windows.Forms.Panel(); 32 | this.listView1 = new System.Windows.Forms.ListView(); 33 | this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 34 | this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 35 | this.btnClose = new System.Windows.Forms.Button(); 36 | this.SuspendLayout(); 37 | // 38 | // chatMessagePanel 39 | // 40 | this.chatMessagePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 41 | | System.Windows.Forms.AnchorStyles.Left) 42 | | System.Windows.Forms.AnchorStyles.Right))); 43 | this.chatMessagePanel.AutoScroll = true; 44 | this.chatMessagePanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); 45 | this.chatMessagePanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 46 | this.chatMessagePanel.Location = new System.Drawing.Point(12, 12); 47 | this.chatMessagePanel.Name = "chatMessagePanel"; 48 | this.chatMessagePanel.Size = new System.Drawing.Size(460, 150); 49 | this.chatMessagePanel.TabIndex = 0; 50 | // 51 | // listView1 52 | // 53 | this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 54 | | System.Windows.Forms.AnchorStyles.Right))); 55 | this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 56 | this.columnHeader1, 57 | this.columnHeader2}); 58 | this.listView1.FullRowSelect = true; 59 | this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; 60 | this.listView1.HideSelection = false; 61 | this.listView1.Location = new System.Drawing.Point(12, 168); 62 | this.listView1.Name = "listView1"; 63 | this.listView1.Size = new System.Drawing.Size(460, 124); 64 | this.listView1.TabIndex = 1; 65 | this.listView1.UseCompatibleStateImageBehavior = false; 66 | this.listView1.View = System.Windows.Forms.View.Details; 67 | // 68 | // columnHeader1 69 | // 70 | this.columnHeader1.Text = "Recipient"; 71 | this.columnHeader1.Width = 200; 72 | // 73 | // columnHeader2 74 | // 75 | this.columnHeader2.Text = "Delivery Status"; 76 | this.columnHeader2.Width = 230; 77 | // 78 | // btnClose 79 | // 80 | this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 81 | this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; 82 | this.btnClose.Location = new System.Drawing.Point(397, 301); 83 | this.btnClose.Name = "btnClose"; 84 | this.btnClose.Size = new System.Drawing.Size(75, 23); 85 | this.btnClose.TabIndex = 2; 86 | this.btnClose.Text = "&Close"; 87 | this.btnClose.UseVisualStyleBackColor = true; 88 | // 89 | // frmMessageInfo 90 | // 91 | this.AcceptButton = this.btnClose; 92 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 93 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 94 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250))))); 95 | this.CancelButton = this.btnClose; 96 | this.ClientSize = new System.Drawing.Size(484, 331); 97 | this.Controls.Add(this.btnClose); 98 | this.Controls.Add(this.listView1); 99 | this.Controls.Add(this.chatMessagePanel); 100 | this.MaximizeBox = false; 101 | this.MinimizeBox = false; 102 | this.MinimumSize = new System.Drawing.Size(500, 250); 103 | this.Name = "frmMessageInfo"; 104 | this.ShowIcon = false; 105 | this.ShowInTaskbar = false; 106 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 107 | this.Text = "Message Info"; 108 | this.ResumeLayout(false); 109 | 110 | } 111 | 112 | #endregion 113 | 114 | private System.Windows.Forms.Panel chatMessagePanel; 115 | private System.Windows.Forms.ListView listView1; 116 | private System.Windows.Forms.Button btnClose; 117 | private System.Windows.Forms.ColumnHeader columnHeader1; 118 | private System.Windows.Forms.ColumnHeader columnHeader2; 119 | } 120 | } -------------------------------------------------------------------------------- /MeshApp/frmMessageInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using MeshApp.UserControls; 21 | using MeshCore.Message; 22 | using MeshCore.Network; 23 | using System.Windows.Forms; 24 | 25 | namespace MeshApp 26 | { 27 | public partial class frmMessageInfo : Form 28 | { 29 | public frmMessageInfo(MeshNetwork.Peer selfPeer, MessageItem message) 30 | { 31 | this.SuspendLayout(); 32 | 33 | InitializeComponent(); 34 | 35 | CustomListViewItem displayItem; 36 | 37 | switch (message.Type) 38 | { 39 | case MessageType.TextMessage: 40 | ChatMessageTextItem textItem = new ChatMessageTextItem(selfPeer, message); 41 | textItem.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; 42 | textItem.Width = chatMessagePanel.Width - 30; 43 | textItem.ContextMenuStrip = null; 44 | 45 | displayItem = textItem; 46 | break; 47 | 48 | case MessageType.FileAttachment: 49 | ChatMessageFileItem fileItem = new ChatMessageFileItem(selfPeer, message); 50 | fileItem.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; 51 | fileItem.Width = chatMessagePanel.Width - 30; 52 | fileItem.ContextMenuStrip = null; 53 | 54 | displayItem = fileItem; 55 | break; 56 | 57 | default: 58 | return; 59 | } 60 | 61 | if (displayItem.Height > 150) 62 | { 63 | chatMessagePanel.Height = 140; 64 | } 65 | else 66 | { 67 | chatMessagePanel.Height = displayItem.Height + 10; 68 | 69 | int heightDiff = 150 - chatMessagePanel.Height; 70 | 71 | this.Height -= heightDiff; 72 | listView1.Top -= heightDiff; 73 | btnClose.Top -= heightDiff; 74 | } 75 | 76 | chatMessagePanel.Controls.Add(displayItem); 77 | 78 | MeshNetwork.Peer[] peers = selfPeer.Network.GetPeers(); 79 | 80 | foreach (MessageRecipient rcpt in message.Recipients) 81 | { 82 | string rcptName = null; 83 | 84 | foreach (MeshNetwork.Peer peer in peers) 85 | { 86 | if (peer.PeerUserId.Equals(rcpt.UserId)) 87 | { 88 | rcptName = peer.ProfileDisplayName; 89 | break; 90 | } 91 | } 92 | 93 | if (rcptName == null) 94 | rcptName = rcpt.UserId.ToString(); 95 | 96 | ListViewItem item = listView1.Items.Add(rcptName); 97 | 98 | switch (rcpt.Status) 99 | { 100 | case MessageRecipientStatus.Delivered: 101 | item.SubItems.Add("Delivered on " + rcpt.DeliveredOn.ToLocalTime().ToString()); 102 | break; 103 | 104 | case MessageRecipientStatus.Undelivered: 105 | item.SubItems.Add("Undelivered"); 106 | break; 107 | } 108 | } 109 | 110 | this.ResumeLayout(); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /MeshApp/frmMessageInfo.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | -------------------------------------------------------------------------------- /MeshApp/frmNetworkInfo.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MeshApp 2 | { 3 | partial class frmNetworkInfo 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.listView1 = new System.Windows.Forms.ListView(); 32 | this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 33 | this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); 34 | this.btnClose = new System.Windows.Forms.Button(); 35 | this.btnRecheck = new System.Windows.Forms.Button(); 36 | this.SuspendLayout(); 37 | // 38 | // listView1 39 | // 40 | this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 41 | | System.Windows.Forms.AnchorStyles.Left) 42 | | System.Windows.Forms.AnchorStyles.Right))); 43 | this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 44 | this.columnHeader1, 45 | this.columnHeader2}); 46 | this.listView1.FullRowSelect = true; 47 | this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; 48 | this.listView1.HideSelection = false; 49 | this.listView1.Location = new System.Drawing.Point(12, 12); 50 | this.listView1.MultiSelect = false; 51 | this.listView1.Name = "listView1"; 52 | this.listView1.Size = new System.Drawing.Size(460, 358); 53 | this.listView1.TabIndex = 0; 54 | this.listView1.UseCompatibleStateImageBehavior = false; 55 | this.listView1.View = System.Windows.Forms.View.Details; 56 | this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick); 57 | // 58 | // columnHeader1 59 | // 60 | this.columnHeader1.Text = "Name"; 61 | this.columnHeader1.Width = 120; 62 | // 63 | // columnHeader2 64 | // 65 | this.columnHeader2.Text = "Value"; 66 | this.columnHeader2.Width = 300; 67 | // 68 | // btnClose 69 | // 70 | this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 71 | this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; 72 | this.btnClose.Location = new System.Drawing.Point(397, 380); 73 | this.btnClose.Name = "btnClose"; 74 | this.btnClose.Size = new System.Drawing.Size(75, 23); 75 | this.btnClose.TabIndex = 2; 76 | this.btnClose.Text = "&Close"; 77 | this.btnClose.UseVisualStyleBackColor = true; 78 | // 79 | // btnRecheck 80 | // 81 | this.btnRecheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 82 | this.btnRecheck.Location = new System.Drawing.Point(12, 380); 83 | this.btnRecheck.Name = "btnRecheck"; 84 | this.btnRecheck.Size = new System.Drawing.Size(75, 23); 85 | this.btnRecheck.TabIndex = 1; 86 | this.btnRecheck.Text = "&Refresh"; 87 | this.btnRecheck.UseVisualStyleBackColor = true; 88 | this.btnRecheck.Click += new System.EventHandler(this.btnRecheck_Click); 89 | // 90 | // frmNetworkInfo 91 | // 92 | this.AcceptButton = this.btnClose; 93 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 94 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 95 | this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250))))); 96 | this.CancelButton = this.btnClose; 97 | this.ClientSize = new System.Drawing.Size(484, 411); 98 | this.Controls.Add(this.btnRecheck); 99 | this.Controls.Add(this.btnClose); 100 | this.Controls.Add(this.listView1); 101 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; 102 | this.MaximizeBox = false; 103 | this.MinimizeBox = false; 104 | this.Name = "frmNetworkInfo"; 105 | this.ShowInTaskbar = false; 106 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 107 | this.Text = "Network Info"; 108 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmNetworkInfo_FormClosing); 109 | this.Load += new System.EventHandler(this.frmNetworkInfo_Load); 110 | this.ResumeLayout(false); 111 | 112 | } 113 | 114 | #endregion 115 | 116 | private System.Windows.Forms.ListView listView1; 117 | private System.Windows.Forms.Button btnClose; 118 | private System.Windows.Forms.ColumnHeader columnHeader1; 119 | private System.Windows.Forms.ColumnHeader columnHeader2; 120 | private System.Windows.Forms.Button btnRecheck; 121 | } 122 | } -------------------------------------------------------------------------------- /MeshApp/frmNetworkInfo.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | True 122 | 123 | 124 | True 125 | 126 | 127 | True 128 | 129 | 130 | True 131 | 132 | -------------------------------------------------------------------------------- /MeshApp/frmProxyConfig.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Net; 22 | using System.Windows.Forms; 23 | using TechnitiumLibrary.Net.Proxy; 24 | 25 | namespace MeshApp 26 | { 27 | public partial class frmProxyConfig : Form 28 | { 29 | #region variables 30 | 31 | string _proxyAddress; 32 | ushort _proxyPort = 0; 33 | 34 | #endregion 35 | 36 | #region constructor 37 | 38 | public frmProxyConfig() 39 | { 40 | InitializeComponent(); 41 | } 42 | 43 | #endregion 44 | 45 | #region form code 46 | 47 | public frmProxyConfig(NetProxyType proxyType, string proxyAddress, int proxyPort, NetworkCredential proxyCredentials) 48 | { 49 | InitializeComponent(); 50 | 51 | if ((proxyPort == 9150) && (proxyAddress == "127.0.0.1")) 52 | cmbProxy.SelectedIndex = 3; 53 | else 54 | cmbProxy.SelectedIndex = (int)proxyType; 55 | 56 | txtProxyAddress.Text = proxyAddress; 57 | txtProxyPort.Text = proxyPort.ToString(); 58 | 59 | if (proxyCredentials != null) 60 | { 61 | chkProxyAuth.Checked = true; 62 | txtProxyUser.Text = proxyCredentials.UserName; 63 | txtProxyPass.Text = proxyCredentials.Password; 64 | } 65 | } 66 | 67 | private void chkProxyAuth_CheckedChanged(object sender, EventArgs e) 68 | { 69 | txtProxyUser.Enabled = chkProxyAuth.Checked; 70 | txtProxyPass.Enabled = chkProxyAuth.Checked; 71 | } 72 | 73 | private void cmbProxy_SelectedIndexChanged(object sender, EventArgs e) 74 | { 75 | btnCheckProxy.Enabled = (cmbProxy.SelectedIndex != 0); 76 | 77 | txtProxyAddress.Enabled = btnCheckProxy.Enabled; 78 | txtProxyPort.Enabled = btnCheckProxy.Enabled; 79 | chkProxyAuth.Enabled = btnCheckProxy.Enabled; 80 | txtProxyUser.Enabled = chkProxyAuth.Enabled && chkProxyAuth.Checked; 81 | txtProxyPass.Enabled = chkProxyAuth.Enabled && chkProxyAuth.Checked; 82 | } 83 | 84 | private void btnOK_Click(object sender, EventArgs e) 85 | { 86 | if ((cmbProxy.SelectedIndex != 0) && (string.IsNullOrWhiteSpace(txtProxyAddress.Text))) 87 | { 88 | MessageBox.Show("The proxy address is missing. Please enter a valid proxy address.", "Proxy Address Missing!", MessageBoxButtons.OK, MessageBoxIcon.Error); 89 | return; 90 | } 91 | 92 | _proxyAddress = txtProxyAddress.Text; 93 | 94 | if (!ushort.TryParse(txtProxyPort.Text, out _proxyPort)) 95 | { 96 | MessageBox.Show("The proxy port number specified is invalid. The number must be in 0-65535 range.", "Invalid Proxy Port Specified!", MessageBoxButtons.OK, MessageBoxIcon.Error); 97 | return; 98 | } 99 | 100 | if ((chkProxyAuth.Checked) && (string.IsNullOrWhiteSpace(txtProxyUser.Text))) 101 | { 102 | MessageBox.Show("The proxy username is missing. Please enter a username.", "Proxy Username Missing!", MessageBoxButtons.OK, MessageBoxIcon.Error); 103 | return; 104 | } 105 | 106 | this.DialogResult = DialogResult.OK; 107 | this.Close(); 108 | } 109 | 110 | private void btnCheckProxy_Click(object sender, EventArgs e) 111 | { 112 | try 113 | { 114 | NetProxyType proxyType = this.ProxyType; 115 | NetProxy proxy; 116 | NetworkCredential credentials = null; 117 | 118 | if (chkProxyAuth.Checked) 119 | credentials = new NetworkCredential(txtProxyUser.Text, txtProxyPass.Text); 120 | 121 | switch (proxyType) 122 | { 123 | case NetProxyType.Http: 124 | proxy = new NetProxy(new WebProxyEx(new Uri("http://" + txtProxyAddress.Text + ":" + int.Parse(txtProxyPort.Text)), false, new string[] { }, credentials)); 125 | break; 126 | 127 | case NetProxyType.Socks5: 128 | proxy = new NetProxy(new SocksClient(txtProxyAddress.Text, int.Parse(txtProxyPort.Text), credentials)); 129 | break; 130 | 131 | default: 132 | return; 133 | } 134 | 135 | proxy.CheckProxyAccess(); 136 | 137 | MessageBox.Show("Mesh was able to connect to the proxy server successfully.", "Proxy Check Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); 138 | } 139 | catch (Exception ex) 140 | { 141 | MessageBox.Show(ex.Message, "Proxy Check Failed!", MessageBoxButtons.OK, MessageBoxIcon.Error); 142 | } 143 | } 144 | 145 | #endregion 146 | 147 | #region properties 148 | 149 | public NetProxyType ProxyType 150 | { get { return (NetProxyType)cmbProxy.SelectedIndex; } } 151 | 152 | public string ProxyAddress 153 | { get { return _proxyAddress; } } 154 | 155 | public int ProxyPort 156 | { get { return _proxyPort; } } 157 | 158 | public NetworkCredential ProxyCredentials 159 | { 160 | get 161 | { 162 | if (chkProxyAuth.Checked) 163 | return new NetworkCredential(txtProxyUser.Text, txtProxyPass.Text); 164 | else 165 | return null; 166 | } 167 | } 168 | 169 | #endregion 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /MeshApp/frmViewGroup.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using MeshCore.Network; 21 | using System; 22 | using System.Drawing; 23 | using System.IO; 24 | using System.Windows.Forms; 25 | 26 | namespace MeshApp 27 | { 28 | public partial class frmViewGroup : Form 29 | { 30 | #region variables 31 | 32 | MeshNetwork _network; 33 | 34 | Image _groupImage; 35 | bool _changesMade = false; 36 | 37 | #endregion 38 | 39 | #region constructor 40 | 41 | public frmViewGroup(MeshNetwork network) 42 | { 43 | InitializeComponent(); 44 | 45 | _network = network; 46 | 47 | //name 48 | string name = _network.NetworkName; 49 | 50 | //name icon 51 | if (name.Length > 0) 52 | { 53 | labIcon.Text = name.Substring(0, 1).ToUpper(); 54 | 55 | int x = name.LastIndexOf(" ", StringComparison.CurrentCultureIgnoreCase); 56 | if (x > 0) 57 | { 58 | labIcon.Text += name.Substring(x + 1, 1).ToUpper(); 59 | } 60 | else if (name.Length > 1) 61 | { 62 | labIcon.Text += name.Substring(1, 1).ToLower(); 63 | } 64 | } 65 | else 66 | { 67 | labIcon.Text = ""; 68 | } 69 | 70 | if (_network.Status == MeshNetworkStatus.Online) 71 | labIcon.BackColor = Color.FromArgb(102, 153, 255); 72 | else 73 | labIcon.BackColor = Color.Gray; 74 | 75 | labName.Text = name; 76 | 77 | //image icon 78 | if ((_network.GroupDisplayImage != null) && (_network.GroupDisplayImage.Length > 0)) 79 | { 80 | using (MemoryStream mS = new MemoryStream(_network.GroupDisplayImage)) 81 | { 82 | _groupImage = Image.FromStream(mS); 83 | picIcon.Image = _groupImage; 84 | } 85 | 86 | picIcon.Visible = true; 87 | labIcon.Visible = false; 88 | } 89 | } 90 | 91 | #endregion 92 | 93 | #region form code 94 | 95 | private void mnuChangePhoto_Click(object sender, EventArgs e) 96 | { 97 | using (frmImageDialog frm = new frmImageDialog()) 98 | { 99 | if (frm.ShowDialog(this) == DialogResult.OK) 100 | { 101 | _groupImage = frm.SelectedImage; 102 | picIcon.Image = _groupImage; 103 | 104 | using (MemoryStream mS = new MemoryStream(4096)) 105 | { 106 | frm.SelectedImage.Save(mS, System.Drawing.Imaging.ImageFormat.Jpeg); 107 | _network.GroupDisplayImage = mS.ToArray(); 108 | } 109 | 110 | _changesMade = true; 111 | 112 | picIcon.Visible = true; 113 | labIcon.Visible = false; 114 | } 115 | } 116 | } 117 | 118 | private void mnuRemovePhoto_Click(object sender, EventArgs e) 119 | { 120 | _network.GroupDisplayImage = null; 121 | _groupImage = null; 122 | picIcon.Image = Properties.Resources.change_photo; 123 | 124 | _changesMade = true; 125 | 126 | picIcon.Visible = false; 127 | labIcon.Visible = true; 128 | } 129 | 130 | private void labIcon_MouseUp(object sender, MouseEventArgs e) 131 | { 132 | switch (e.Button) 133 | { 134 | case MouseButtons.Left: 135 | mnuChangePhoto_Click(null, null); 136 | break; 137 | 138 | case MouseButtons.Right: 139 | mnuRemovePhoto.Enabled = (_groupImage != null); 140 | Control control = sender as Control; 141 | mnuGroupImage.Show(control, e.Location); 142 | break; 143 | } 144 | } 145 | 146 | private void labIcon_MouseEnter(object sender, EventArgs e) 147 | { 148 | if (_groupImage == null) 149 | { 150 | picIcon.Visible = true; 151 | labIcon.Visible = false; 152 | } 153 | else 154 | { 155 | picIcon.Image = Properties.Resources.change_photo; 156 | } 157 | } 158 | 159 | private void picIcon_MouseEnter(object sender, EventArgs e) 160 | { 161 | if (_groupImage != null) 162 | picIcon.Image = Properties.Resources.change_photo; 163 | } 164 | 165 | private void picIcon_MouseLeave(object sender, EventArgs e) 166 | { 167 | if (_groupImage == null) 168 | { 169 | labIcon.Visible = true; 170 | picIcon.Visible = false; 171 | } 172 | else 173 | { 174 | picIcon.Image = _groupImage; 175 | } 176 | } 177 | 178 | private void mnuCopy_Click(object sender, EventArgs e) 179 | { 180 | try 181 | { 182 | Clipboard.Clear(); 183 | Clipboard.SetText(labName.Text); 184 | } 185 | catch 186 | { } 187 | } 188 | 189 | private void btnClose_Click(object sender, EventArgs e) 190 | { 191 | if (_changesMade) 192 | this.DialogResult = DialogResult.OK; 193 | 194 | this.Close(); 195 | } 196 | 197 | #endregion 198 | } 199 | } 200 | -------------------------------------------------------------------------------- /MeshApp/logo2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechnitiumSoftware/Mesh/4a7dc4f4dab999143baa4247606089479805d61a/MeshApp/logo2.ico -------------------------------------------------------------------------------- /MeshCore/Debug.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2018 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.Threading; 22 | 23 | namespace MeshCore 24 | { 25 | public static class Debug 26 | { 27 | #region variables 28 | 29 | static object _lockObj = new object(); 30 | static IDebug _debug; 31 | 32 | #endregion 33 | 34 | #region public static 35 | 36 | public static void SetDebug(IDebug debug) 37 | { 38 | if (_debug == null) 39 | _debug = debug; 40 | } 41 | 42 | public static void Write(string source, Exception ex) 43 | { 44 | if (_debug != null) 45 | Write(source, ex.ToString()); 46 | } 47 | 48 | public static void Write(string source, string message) 49 | { 50 | if (_debug != null) 51 | { 52 | Monitor.Enter(_lockObj); 53 | try 54 | { 55 | _debug.Write("[" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "] [" + source + "] " + message + "\r\n"); 56 | } 57 | catch 58 | { } 59 | finally 60 | { 61 | Monitor.Exit(_lockObj); 62 | } 63 | } 64 | } 65 | 66 | #endregion 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /MeshCore/IDebug.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2018 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | namespace MeshCore 21 | { 22 | public interface IDebug 23 | { 24 | void Write(string message); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MeshCore/MeshCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D6B9A05E-7417-4902-8B41-114CD0A8130E} 8 | Library 9 | Properties 10 | MeshCore 11 | MeshCore 12 | v4.6.1 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | ..\..\..\TechnitiumLibrary\bin\TechnitiumLibrary.IO.dll 37 | 38 | 39 | ..\..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.dll 40 | 41 | 42 | ..\..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.Tor.dll 43 | 44 | 45 | ..\..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Net.UPnP.dll 46 | 47 | 48 | ..\..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Security.Cryptography.dll 49 | 50 | 51 | ..\..\..\TechnitiumLibrary\bin\TechnitiumLibrary.Security.Cryptography.EllipticCurve.dll 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /MeshCore/MeshException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | 22 | namespace MeshCore 23 | { 24 | [Serializable()] 25 | public class MeshException : Exception 26 | { 27 | public MeshException() 28 | { } 29 | 30 | public MeshException(string message) 31 | : base(message) 32 | { } 33 | 34 | public MeshException(string message, Exception innerException) 35 | : base(message, innerException) 36 | { } 37 | 38 | protected MeshException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) 39 | : base(info, context) 40 | { } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /MeshCore/Message/MessageRecipient.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2018 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using TechnitiumLibrary.IO; 23 | 24 | namespace MeshCore.Message 25 | { 26 | public enum MessageRecipientStatus : byte 27 | { 28 | Undelivered = 0, 29 | Delivered = 1 30 | } 31 | 32 | public class MessageRecipient 33 | { 34 | #region variables 35 | 36 | readonly BinaryNumber _userId; 37 | 38 | MessageRecipientStatus _status = MessageRecipientStatus.Undelivered; 39 | DateTime _deliveredOn; 40 | 41 | #endregion 42 | 43 | #region constructor 44 | 45 | public MessageRecipient(BinaryNumber userId) 46 | { 47 | _userId = userId; 48 | } 49 | 50 | public MessageRecipient(BinaryReader bR) 51 | { 52 | switch (bR.ReadByte()) //version 53 | { 54 | case 1: 55 | _userId = new BinaryNumber(bR.BaseStream); 56 | _status = (MessageRecipientStatus)bR.ReadByte(); 57 | _deliveredOn = bR.ReadDate(); 58 | break; 59 | 60 | default: 61 | throw new InvalidDataException("Cannot decode data format: version not supported."); 62 | } 63 | } 64 | 65 | #endregion 66 | 67 | #region public 68 | 69 | public void SetDeliveredStatus() 70 | { 71 | _status = MessageRecipientStatus.Delivered; 72 | _deliveredOn = DateTime.UtcNow; 73 | } 74 | 75 | public void WriteTo(BinaryWriter bW) 76 | { 77 | bW.Write((byte)1); //version 78 | _userId.WriteTo(bW.BaseStream); 79 | bW.Write((byte)_status); 80 | bW.Write(_deliveredOn); 81 | } 82 | 83 | #endregion 84 | 85 | #region properties 86 | 87 | public BinaryNumber UserId 88 | { get { return _userId; } } 89 | 90 | public MessageRecipientStatus Status 91 | { get { return _status; } } 92 | 93 | public DateTime DeliveredOn 94 | { get { return _deliveredOn; } } 95 | 96 | #endregion 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /MeshCore/Network/DHT/IDhtConnectionManager.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2018 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System.IO; 21 | using System.Net; 22 | 23 | namespace MeshCore.Network.DHT 24 | { 25 | public interface IDhtConnectionManager 26 | { 27 | Stream GetConnection(EndPoint remoteNodeEP); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /MeshCore/Network/DHT/NodeContact.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2018 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Net; 23 | using System.Security.Cryptography; 24 | using TechnitiumLibrary.IO; 25 | using TechnitiumLibrary.Net; 26 | 27 | namespace MeshCore.Network.DHT 28 | { 29 | class NodeContact 30 | { 31 | #region variables 32 | 33 | const int NODE_RPC_FAIL_LIMIT = 5; //max failed RPC count before declaring node stale 34 | const int NODE_STALE_TIMEOUT_SECONDS = 900; //15mins timeout before declaring node stale 35 | 36 | static readonly byte[] NODE_ID_SALT = new byte[] { 0xF4, 0xC7, 0x56, 0x9A, 0xA3, 0xAD, 0xC9, 0xA7, 0x13, 0x0E, 0xCA, 0x56, 0x56, 0xA3, 0x52, 0x8F, 0xFE, 0x6E, 0x9C, 0x72 }; 37 | 38 | readonly EndPoint _nodeEP; 39 | readonly BinaryNumber _nodeId; 40 | 41 | protected bool _isCurrentNode; 42 | DateTime _lastSeen; 43 | int _successfulRpcCount = 0; 44 | int _failRpcCount = 0; 45 | 46 | #endregion 47 | 48 | #region constructor 49 | 50 | public NodeContact(BinaryReader bR) 51 | { 52 | _nodeEP = EndPointExtension.Parse(bR); 53 | _nodeId = GetNodeId(_nodeEP); 54 | } 55 | 56 | public NodeContact(EndPoint nodeEP) 57 | { 58 | _nodeEP = nodeEP; 59 | _nodeId = GetNodeId(_nodeEP); 60 | } 61 | 62 | protected NodeContact(BinaryNumber nodeId, EndPoint nodeEP) 63 | { 64 | _nodeId = nodeId; 65 | _nodeEP = nodeEP; 66 | } 67 | 68 | #endregion 69 | 70 | #region static 71 | 72 | private static BinaryNumber GetNodeId(EndPoint nodeEP) 73 | { 74 | using (HMAC hmac = new HMACSHA256(NODE_ID_SALT)) 75 | { 76 | using (MemoryStream mS = new MemoryStream(32)) 77 | { 78 | nodeEP.WriteTo(new BinaryWriter(mS)); 79 | mS.Position = 0; 80 | 81 | return new BinaryNumber(hmac.ComputeHash(mS)); 82 | } 83 | } 84 | } 85 | 86 | #endregion 87 | 88 | #region public 89 | 90 | public bool IsStale() 91 | { 92 | if (_isCurrentNode) 93 | return false; 94 | else 95 | return ((_failRpcCount > NODE_RPC_FAIL_LIMIT) || ((DateTime.UtcNow - _lastSeen).TotalSeconds > NODE_STALE_TIMEOUT_SECONDS)); 96 | } 97 | 98 | public void UpdateLastSeenTime() 99 | { 100 | _lastSeen = DateTime.UtcNow; 101 | _successfulRpcCount++; 102 | _failRpcCount = 0; 103 | } 104 | 105 | public void IncrementRpcFailCount() 106 | { 107 | _failRpcCount++; 108 | } 109 | 110 | public void WriteTo(BinaryWriter bW) 111 | { 112 | _nodeEP.WriteTo(bW); 113 | } 114 | 115 | public override bool Equals(object obj) 116 | { 117 | if (obj is null) 118 | return false; 119 | 120 | if (ReferenceEquals(this, obj)) 121 | return true; 122 | 123 | NodeContact contact = obj as NodeContact; 124 | if (contact == null) 125 | return false; 126 | 127 | if (_nodeEP.Equals(contact._nodeEP)) 128 | return true; 129 | 130 | return _nodeId.Equals(contact._nodeId); 131 | } 132 | 133 | public override int GetHashCode() 134 | { 135 | return _nodeId.GetHashCode(); 136 | } 137 | 138 | public override string ToString() 139 | { 140 | return _nodeEP.ToString(); 141 | } 142 | 143 | #endregion 144 | 145 | #region properties 146 | 147 | public EndPoint NodeEP 148 | { get { return _nodeEP; } } 149 | 150 | public BinaryNumber NodeId 151 | { get { return _nodeId; } } 152 | 153 | public bool IsCurrentNode 154 | { get { return _isCurrentNode; } } 155 | 156 | public DateTime LastSeen 157 | { get { return _lastSeen; } } 158 | 159 | public int SuccessfulRpcCount 160 | { get { return _successfulRpcCount; } } 161 | 162 | #endregion 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /MeshCore/Network/MeshNetworkPeerInfo.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Net; 23 | using System.Text; 24 | using TechnitiumLibrary.IO; 25 | using TechnitiumLibrary.Net; 26 | 27 | namespace MeshCore.Network 28 | { 29 | public class MeshNetworkPeerInfo 30 | { 31 | #region variables 32 | 33 | readonly BinaryNumber _peerUserId; 34 | readonly string _peerName; //optional 35 | readonly EndPoint[] _peerEPs; 36 | 37 | #endregion 38 | 39 | #region constructor 40 | 41 | public MeshNetworkPeerInfo(BinaryNumber peerUserId, IPEndPoint peerEP) 42 | { 43 | _peerUserId = peerUserId; 44 | _peerEPs = new IPEndPoint[] { peerEP }; 45 | } 46 | 47 | public MeshNetworkPeerInfo(BinaryNumber peerUserId, string peerName, EndPoint[] peerEPs) 48 | { 49 | _peerUserId = peerUserId; 50 | _peerName = peerName; 51 | _peerEPs = peerEPs; 52 | } 53 | 54 | public MeshNetworkPeerInfo(BinaryReader bR) 55 | { 56 | _peerUserId = new BinaryNumber(bR.BaseStream); 57 | 58 | _peerName = Encoding.UTF8.GetString(bR.ReadBytes(bR.ReadByte())); 59 | if (_peerName == "") 60 | _peerName = null; 61 | 62 | { 63 | _peerEPs = new EndPoint[bR.ReadByte()]; 64 | 65 | for (int i = 0; i < _peerEPs.Length; i++) 66 | _peerEPs[i] = EndPointExtension.Parse(bR); 67 | } 68 | } 69 | 70 | #endregion 71 | 72 | #region public 73 | 74 | public void WriteTo(BinaryWriter bW) 75 | { 76 | _peerUserId.WriteTo(bW.BaseStream); 77 | 78 | if (_peerName == null) 79 | bW.Write((byte)0); 80 | else 81 | bW.WriteShortString(_peerName); 82 | 83 | bW.Write(Convert.ToByte(_peerEPs.Length)); 84 | 85 | foreach (EndPoint peerEP in _peerEPs) 86 | peerEP.WriteTo(bW); 87 | } 88 | 89 | public override bool Equals(object obj) 90 | { 91 | if (obj == null) 92 | return false; 93 | 94 | if (ReferenceEquals(this, obj)) 95 | return true; 96 | 97 | MeshNetworkPeerInfo objPeerInfo = obj as MeshNetworkPeerInfo; 98 | 99 | return _peerUserId.Equals(objPeerInfo._peerUserId); 100 | } 101 | 102 | public override int GetHashCode() 103 | { 104 | return _peerUserId.GetHashCode(); 105 | } 106 | 107 | public override string ToString() 108 | { 109 | if (_peerName == null) 110 | return "[" + _peerUserId.ToString() + "]"; 111 | 112 | return _peerName + " [" + _peerUserId.ToString() + "]"; 113 | } 114 | 115 | #endregion 116 | 117 | #region properties 118 | 119 | public BinaryNumber PeerUserId 120 | { get { return _peerUserId; } } 121 | 122 | public string PeerDisplayName 123 | { 124 | get 125 | { 126 | if (_peerName == null) 127 | return _peerUserId.ToString(); 128 | 129 | return _peerName; 130 | } 131 | } 132 | 133 | public EndPoint[] PeerEPs 134 | { get { return _peerEPs; } } 135 | 136 | #endregion 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /MeshCore/Network/SecureChannel/SecureChannelException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | Technitium Mesh 3 | Copyright (C) 2019 Shreyas Zare (shreyas@technitium.com) 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Net; 23 | using TechnitiumLibrary.IO; 24 | 25 | namespace MeshCore.Network.SecureChannel 26 | { 27 | public enum SecureChannelCode : byte 28 | { 29 | None = 0, 30 | RemoteError = 1, 31 | ProtocolVersionNotSupported = 2, 32 | NoMatchingCipherAvailable = 3, 33 | NoMatchingOptionsAvailable = 4, 34 | PskAuthenticationFailed = 5, 35 | PeerAuthenticationFailed = 6, 36 | UntrustedRemotePeerUserId = 7, 37 | MessageAuthenticationFailed = 8, 38 | RenegotiationFailed = 9, 39 | UnknownException = 254, 40 | } 41 | 42 | [Serializable()] 43 | public class SecureChannelException : IOException 44 | { 45 | #region variable 46 | 47 | readonly SecureChannelCode _code; 48 | readonly EndPoint _peerEP; 49 | readonly BinaryNumber _peerUserId; 50 | 51 | #endregion 52 | 53 | #region constructor 54 | 55 | public SecureChannelException() 56 | { } 57 | 58 | public SecureChannelException(string message) : base(message) 59 | { } 60 | 61 | public SecureChannelException(string message, Exception innerException) : base(message, innerException) 62 | { } 63 | 64 | public SecureChannelException(SecureChannelCode code, EndPoint peerEP, BinaryNumber peerUserId) 65 | { 66 | _code = code; 67 | _peerEP = peerEP; 68 | _peerUserId = peerUserId; 69 | } 70 | 71 | public SecureChannelException(SecureChannelCode code, EndPoint peerEP, BinaryNumber peerUserId, string message) 72 | : base(message) 73 | { 74 | _code = code; 75 | _peerEP = peerEP; 76 | _peerUserId = peerUserId; 77 | } 78 | 79 | public SecureChannelException(SecureChannelCode code, EndPoint peerEP, BinaryNumber peerUserId, string message, Exception innerException) 80 | : base(message, innerException) 81 | { 82 | _code = code; 83 | _peerEP = peerEP; 84 | _peerUserId = peerUserId; 85 | } 86 | 87 | protected SecureChannelException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) 88 | : base(info, context) 89 | { } 90 | 91 | #endregion 92 | 93 | #region property 94 | 95 | public SecureChannelCode Code 96 | { get { return _code; } } 97 | 98 | public EndPoint PeerEP 99 | { get { return _peerEP; } } 100 | 101 | public BinaryNumber PeerUserId 102 | { get { return _peerUserId; } } 103 | 104 | #endregion 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /MeshCore/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mesh Core")] 9 | [assembly: AssemblyDescription("A secure, anonymous, peer-to-peer instant messenger.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Technitium")] 12 | [assembly: AssemblyProduct("Mesh")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d6b9a05e-7417-4902-8b41-114cd0a8130e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.1.0.0")] 36 | [assembly: AssemblyFileVersion("1.1.0.0")] 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Technitium Mesh
4 | Technitium Mesh 5 |

6 |
7 | Get a secure, anonymous, peer-to-peer instant messenger
8 | One messenger for Internet and LAN chat with end-to-end encryption 9 |

10 |

11 | Technitium Mesh 12 |

13 | 14 | Technitium Mesh is a secure, anonymous, peer-to-peer (p2p), open source instant messenger designed to provide end-to-end encryption. Primary aim of developing this instant messenger is to provide privacy which is achieved using cryptography and anonymity using Tor network. It can be used over Internet and private LAN networks (without Internet) for instant messaging and file transfer with support for private chats and group chats. 15 | 16 | Mesh is based on [Bit Chat](https://github.com/TechnitiumSoftware/BitChatClient) and is its successor. Mesh takes core ideas from its predecessor and removes a few. Notably, Mesh does not require centralized user registration and provides anonymous profile support using Tor hidden service. It also removes use of BitTorrent trackers for finding peers which was causing issues with Bit Chat since some ISPs blocking BitTorrent traffic would also block Bit Chat traffic. Instead, Mesh relies only on [Distributed Hash Tables (DHT)](https://en.wikipedia.org/wiki/Distributed_hash_table) for all purposes. 17 | 18 | Mesh allows creating both pure p2p and anonymous profiles with support for running multiple profiles concurrently. Both p2p and anonymous profiles are interoperable such that a p2p profile user can connect with an anonymous profile user via Tor Network. 19 | 20 | With Mesh, there is no meta data generated. User identifier is designed in such a way that it can be changed anytime to hide identity. Since, there is no user registration, we don't know who uses Mesh or how many people use it. In p2p mode, the connections use IPv4 or IPv6 connectivity directly to connect with peers without any server in between. With anonymous mode, all connectivity occurs over Tor network and uses Tor hidden service to accept inbound connections. 21 | 22 | # Peer-to-Peer 23 | - Serverless, peer-to-peer architecture that uses [Distributed Hash Tables (DHT)](https://en.wikipedia.org/wiki/Distributed_hash_table). 24 | - No meta data is stored since even we don't know to whom you are chatting with. 25 | - Works as LAN chat just as it works on the Internet. 26 | - Works in private LAN networks not connected to Internet. 27 | - Anonymous profiles use [Tor Network](https://www.torproject.org/) to hide your identity. 28 | 29 | # Secure 30 | - Uses RSA 2048 bit keys to generate profiles. 31 | - Provides end-to-end encryption with [Perfect Forward Secrecy (PFS)](https://en.wikipedia.org/wiki/Forward_secrecy) using DHE-2048 or ECDHE-256. 32 | - Protocol is secured with AES 256-bit encryption with [Authenticated Encryption](https://en.wikipedia.org/wiki/Authenticated_encryption). 33 | - Changeable user identifier to hide identity. 34 | - Open source implementation allows you to inspect the code. 35 | 36 | # Installation 37 | - **Windows (Setup)**: [Download setup installer](https://download.technitium.com/mesh/MeshSetup.zip) 38 | - **Windows (Standalone)**: [Download portable zip](https://download.technitium.com/mesh/MeshPortable.zip) 39 | 40 | # Frequently Asked Questions (FAQ) 41 | Read this [FAQ](https://mesh.im/faq.html) page which should answer most of your queries. 42 | 43 | # Support 44 | For support, send an email to support@technitium.com. For any issues, feedback, or feature request, create an issue on [GitHub](https://github.com/TechnitiumSoftware/Mesh/issues). 45 | 46 | # Become A Patron 47 | Make contribution to Technitium by becoming a Patron and help making new software, updates, and features possible. 48 | 49 | [Become a Patron now!](https://www.patreon.com/technitium) 50 | --------------------------------------------------------------------------------