Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Source/SteamInviteSpamFilter/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<setting name="ignoreLevel" serializeAs="String">
<value>0</value>
</setting>
<setting name="blockInstead" serializeAs="String">
<value>ignore</value>
</setting>
</SteamInviteSpamFilter.Properties.Settings>
</userSettings>
</configuration>
9 changes: 9 additions & 0 deletions Source/SteamInviteSpamFilter/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura IncludeDebugSymbols='false'>
<ExcludeAssemblies>
mscorlib
</ExcludeAssemblies>
</Costura>

</Weavers>
4 changes: 2 additions & 2 deletions Source/SteamInviteSpamFilter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.1.0")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyVersion("0.0.1.1")]
[assembly: AssemblyFileVersion("0.0.1.1")]
14 changes: 13 additions & 1 deletion Source/SteamInviteSpamFilter/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Source/SteamInviteSpamFilter/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
<Setting Name="ignoreLevel" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="blockInstead" Type="System.String" Scope="User">
<Value Profile="(Default)">ignore</Value>
</Setting>
</Settings>
</SettingsFile>
14 changes: 12 additions & 2 deletions Source/SteamInviteSpamFilter/SteamInviteSpamFilter.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -107,7 +107,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<None Include="Resources\check-2x.png" />
Expand All @@ -119,9 +121,17 @@
<None Include="Resources\select2-spinner.gif" />
</ItemGroup>
<ItemGroup>
<Content Include="FodyWeavers.xml" />
<Content Include="sisf.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.1.26.1\build\Fody.targets" Condition="Exists('..\packages\Fody.1.26.1\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.1.26.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.26.1\build\Fody.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
94 changes: 55 additions & 39 deletions Source/SteamInviteSpamFilter/frmMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 47 additions & 3 deletions Source/SteamInviteSpamFilter/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task IgnoreInvite(string user_id)
new KeyValuePair<string, string>("xml", "1"),
new KeyValuePair<string, string>("action", "approvePending"),
new KeyValuePair<string, string>("itype", "friend"),
new KeyValuePair<string, string>("perform", "ignore"),
new KeyValuePair<string, string>("perform", Properties.Settings.Default.blockInstead),
new KeyValuePair<string, string>("id", user_id),
new KeyValuePair<string, string>("sessionID", Properties.Settings.Default.sessionid)
});
Expand Down Expand Up @@ -270,11 +270,23 @@ private void frmMain_Load(object sender, EventArgs e)
if (Properties.Settings.Default.enabled)
{
chkEnable.Checked = true;
chkBlock.Enabled = true;
}
else
{
chkEnable.Checked = false;
chkBlock.Enabled = false;
}

if (Properties.Settings.Default.blockInstead == "block")
{
chkBlock.Checked = true;
}
else
{
chkBlock.Checked = false;
}

numLevel.Value = Properties.Settings.Default.ignoreLevel;
}

Expand All @@ -283,15 +295,30 @@ private void chkEnable_CheckedChanged(object sender, EventArgs e)
if (chkEnable.Checked)
{
Properties.Settings.Default.enabled = true;
chkBlock.Enabled = true;
}
else
{
Properties.Settings.Default.enabled = false;
chkBlock.Enabled = false;
}
Properties.Settings.Default.Save();
tmrCheckInvites.Interval = 100;
}

private void chkBlock_CheckedChanged(object sender, EventArgs e)
{
if (chkBlock.Checked)
{
Properties.Settings.Default.blockInstead = "block";
}
else
{
Properties.Settings.Default.blockInstead = "ignore";
}
Properties.Settings.Default.Save();
}

private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
Expand All @@ -311,10 +338,27 @@ private void frmMain_Resize(object sender, EventArgs e)
}
}

private void notifyIcon1_MouseSingleClick(object Sender, MouseEventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
this.Activate();
}
}

private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
this.WindowState = FormWindowState.Normal;
if (this.WindowState != FormWindowState.Normal)
{
this.Show();
this.Activate();
this.WindowState = FormWindowState.Normal;
}
else
{
this.Hide();
this.WindowState = FormWindowState.Minimized;
}
}

private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down
2 changes: 2 additions & 0 deletions Source/SteamInviteSpamFilter/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="1.3.3.0" targetFramework="net451" />
<package id="Fody" version="1.26.1" targetFramework="net451" developmentDependency="true" />
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net45" />
</packages>
Binary file modified SteamInviteSpamFilter.exe
Binary file not shown.