Commit 60e93c5d authored by Sylvain Berfini's avatar Sylvain Berfini

Added feature to email linphone logs

parent 5990a983
......@@ -922,6 +922,15 @@ namespace Linphone.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Send by email.
/// </summary>
public static string SendEmail {
get {
return ResourceManager.GetString("SendEmail", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to send.
/// </summary>
......
......@@ -531,4 +531,7 @@ Do you want to report it to the developpers ? It will help fix it faster.</value
<data name="InvalidSipAddressError" xml:space="preserve">
<value>The SIP address you provided is incorrect. Please ensure it matches the format username@domain.</value>
</data>
<data name="SendEmail" xml:space="preserve">
<value>Send by email</value>
</data>
</root>
\ No newline at end of file
using Linphone.Model;
using Linphone.Resources;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Tasks;
using System;
using System.IO;
using System.Text;
......@@ -80,6 +81,25 @@ namespace Linphone.Views
FormatAndDisplayLogs(logs);
}
private async void email_Click_1(object sender, EventArgs e)
{
try
{
// Limit the amount of linphone logs to the last 50ko
string logs = await ReadLogs();
if (logs.Length > 50000)
{
logs = logs.Substring(logs.Length - 50000);
}
EmailComposeTask email = new EmailComposeTask();
email.To = "linphone-wphone@belledonne-communications.com";
email.Subject = "Logs report";
email.Body = logs;
email.Show();
}
catch (Exception) { }
}
private void BuildLocalizedApplicationBar()
{
ApplicationBar = new ApplicationBar();
......@@ -88,6 +108,11 @@ namespace Linphone.Views
appBarRefresh.Text = AppResources.Refresh;
ApplicationBar.Buttons.Add(appBarRefresh);
appBarRefresh.Click += refresh_Click_1;
ApplicationBarIconButton appBarEmail = new ApplicationBarIconButton(new Uri("/Assets/AppBar/feature.email.png", UriKind.Relative));
appBarEmail.Text = AppResources.SendEmail;
ApplicationBar.Buttons.Add(appBarEmail);
appBarEmail.Click += email_Click_1;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment