aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/thedevstack/xmpp/mamloader
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/thedevstack/xmpp/mamloader')
-rw-r--r--src/de/thedevstack/xmpp/mamloader/MamLoader.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/de/thedevstack/xmpp/mamloader/MamLoader.java b/src/de/thedevstack/xmpp/mamloader/MamLoader.java
index f60c91a..da2b427 100644
--- a/src/de/thedevstack/xmpp/mamloader/MamLoader.java
+++ b/src/de/thedevstack/xmpp/mamloader/MamLoader.java
@@ -16,8 +16,8 @@ import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smackx.forward.packet.Forwarded;
public class MamLoader {
- private static final SimpleDateFormat SDF = new SimpleDateFormat("dd.MM.YYYY HH:mm:ss");
- private static final SimpleDateFormat INPUT = new SimpleDateFormat("dd.MM.YYYY");
+ private static final SimpleDateFormat SDF = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
+ private static final SimpleDateFormat INPUT = new SimpleDateFormat("dd.MM.yyyy");
public static void main(String[] args) throws InterruptedException, SmackException, IOException, XMPPException {
if (2 > args.length) {
@@ -60,6 +60,8 @@ public class MamLoader {
System.exit(1);
}
+ System.out.println("Your JID: " + myjid);
+
Console console = System.console();
if (null == console) {
System.out.println("Testenvironment!");
@@ -72,6 +74,23 @@ public class MamLoader {
}
System.out.println("Loading history for chats with " + jid);
+ System.out.println("Limitations:");
+ if (null == start && null == end && -1 == limit) {
+ System.out.println("None");
+ } else {
+ if (null != start) {
+ System.out.println("Starting from: " + INPUT.format(start));
+ }
+ if (null != end) {
+ System.out.println("Ending at: " + INPUT.format(end));
+ }
+ if (-1 < limit) {
+ System.out.println("Only collecting " + limit + " messages. The limit is applied to all messages but only messages containing a body are printed out.");
+ }
+ }
+ if (debug) {
+ System.out.println("Debugging is enabled.");
+ }
MamLoadClient mlc = new MamLoadClient(debug);
try {
mlc.connectAndLogin(myjid, password);
@@ -102,7 +121,7 @@ public class MamLoader {
return INPUT.parse(dateToParse);
} catch (ParseException e) {
System.err.println("Could not parse date: " + dateToParse);
- System.err.println("Needed format: dd.MM.YYYY");
+ System.err.println("Needed format: dd.MM.yyyy");
System.exit(1);
return null;