Start looking at setting the avatar automatically.
It's untested though.
This commit is contained in:
parent
0bf68aa35c
commit
cbbc750955
1 changed files with 15 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using S22.Xmpp;
|
using S22.Xmpp;
|
||||||
using S22.Xmpp.Client;
|
using S22.Xmpp.Client;
|
||||||
using S22.Xmpp.Im;
|
using S22.Xmpp.Im;
|
||||||
|
@ -13,6 +14,8 @@ namespace RhinoReminds
|
||||||
public string Filepath = "./reminders.xml";
|
public string Filepath = "./reminders.xml";
|
||||||
public string Jid = null;
|
public string Jid = null;
|
||||||
|
|
||||||
|
public string AvatarFilepath = string.Empty;
|
||||||
|
|
||||||
public string Password = null;
|
public string Password = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +47,7 @@ namespace RhinoReminds
|
||||||
Console.WriteLine(" -h --help Show this message");
|
Console.WriteLine(" -h --help Show this message");
|
||||||
Console.WriteLine($" -f --file Specify where to save reminders (default: {settings.Filepath})");
|
Console.WriteLine($" -f --file Specify where to save reminders (default: {settings.Filepath})");
|
||||||
Console.WriteLine(" --domain {domain} Set the domain users are allowed to originate at. Defaults to any domain.");
|
Console.WriteLine(" --domain {domain} Set the domain users are allowed to originate at. Defaults to any domain.");
|
||||||
|
Console.WriteLine(" --avatar Update the XMPP account's avatar to the specified image. By default the avatar is not updated.");
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
Console.WriteLine("Environment Variables:");
|
Console.WriteLine("Environment Variables:");
|
||||||
Console.WriteLine(" XMPP_JID The JID to login to");
|
Console.WriteLine(" XMPP_JID The JID to login to");
|
||||||
|
@ -59,6 +63,10 @@ namespace RhinoReminds
|
||||||
settings.AllowedDomain = args[++i];
|
settings.AllowedDomain = args[++i];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case "--avatar":
|
||||||
|
settings.AvatarFilepath = args[++i];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +84,13 @@ namespace RhinoReminds
|
||||||
ReminderFilePath = settings.Filepath
|
ReminderFilePath = settings.Filepath
|
||||||
};
|
};
|
||||||
client.AllowedDomains.Add(settings.AllowedDomain);
|
client.AllowedDomains.Add(settings.AllowedDomain);
|
||||||
client.Start().Wait();
|
// Connect to the server & start listening
|
||||||
|
Task clientListener = client.Start();
|
||||||
|
// Update the avatar if appropriate
|
||||||
|
if(settings.AvatarFilepath != string.Empty)
|
||||||
|
client.SetAvatar(settings.AvatarFilepath);
|
||||||
|
// Make sure the program doesn't exit whilst we're connected
|
||||||
|
clientListener.Wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue