aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/thedevstack/xmpp/mamloader
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-11-17 19:23:57 +0100
committersteckbrief <steckbrief@chefmail.de>2017-11-17 19:23:57 +0100
commitcdd12bae8ada7c59109978d0bda54a0673606cf9 (patch)
tree81502b8fffb88b8c54804270593ecbdbbfd4ce8a /src/de/thedevstack/xmpp/mamloader
parent5cacf94ecca5b45ffdaba0d85506d64117643fd8 (diff)
input date format fixed. Some more output added.
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;