From 8e51695e698b6650ad5f8732613632614e107b5d Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sat, 24 Feb 2018 12:43:34 +0100 Subject: [PATCH] Add account class and missing license --- .../de/vanitasvitae/slam/mvp/DummyStore.java | 11 ++++----- .../mvp/contracts/ConversationContract.java | 1 - .../message/AbstractMessageContract.java | 17 +++++++++++++ .../message/AudioMessageContract.java | 17 +++++++++++++ .../message/ImageMessageContract.java | 17 +++++++++++++ .../message/MediaMessageContract.java | 17 +++++++++++++ .../message/TextMessageContract.java | 17 +++++++++++++ .../message/VideoMessageContract.java | 17 +++++++++++++ .../slam/ui/NonPagingViewPager.java | 17 +++++++++++++ .../de/vanitasvitae/slam/xmpp/Account.java | 24 +++++++++++++++++++ .../de/vanitasvitae/slam/xmpp/Contact.java | 16 ++++++++++--- .../slam/xmpp/SentReadMarker.java | 17 +++++++++++++ .../slam/xmpp/message/AbstractMessage.java | 17 +++++++++++++ .../slam/xmpp/message/AudioMessage.java | 17 +++++++++++++ .../slam/xmpp/message/ImageMessage.java | 17 +++++++++++++ .../slam/xmpp/message/MediaMessage.java | 17 +++++++++++++ .../slam/xmpp/message/TextMessage.java | 17 +++++++++++++ .../slam/xmpp/message/VideoMessage.java | 17 +++++++++++++ 18 files changed, 279 insertions(+), 11 deletions(-) create mode 100644 mobile/src/main/java/de/vanitasvitae/slam/xmpp/Account.java diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/DummyStore.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/DummyStore.java index d5eba17..d0213be 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/DummyStore.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/DummyStore.java @@ -29,9 +29,6 @@ import java.util.Map; import de.vanitasvitae.slam.xmpp.Contact; -/** - * Created by Paul Schaub on 11.02.18. - */ public class DummyStore { public final Map> conversations = new HashMap<>(); @@ -45,10 +42,10 @@ public class DummyStore { private List contacts() throws XmppStringprepException { List l = new ArrayList<>(); - l.add(new Contact(JidCreate.entityBareFrom("alice@wonderland.lit"), "Alice")); - l.add(new Contact(JidCreate.entityBareFrom("bob@builder.tv"))); - l.add(new Contact(JidCreate.entityBareFrom("juliet@capulet.lit"), "Juliet")); - l.add(new Contact(JidCreate.entityBareFrom("romeo@montague.lit"), "Romeo <3")); + l.add(new Contact(JidCreate.entityBareFrom("alice@wonderland.lit"), null, "Alice")); + l.add(new Contact(JidCreate.entityBareFrom("bob@builder.tv"), null)); + l.add(new Contact(JidCreate.entityBareFrom("juliet@capulet.lit"), null, "Juliet")); + l.add(new Contact(JidCreate.entityBareFrom("romeo@montague.lit"), null, "Romeo <3")); return l; } diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/ConversationContract.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/ConversationContract.java index ab0bdc6..cbfdd29 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/ConversationContract.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/ConversationContract.java @@ -17,7 +17,6 @@ */ package de.vanitasvitae.slam.mvp.contracts; -import org.jivesoftware.smack.packet.Message; import org.jxmpp.jid.EntityBareJid; import java.util.List; diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AbstractMessageContract.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AbstractMessageContract.java index 4ad4ade..c9c8132 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AbstractMessageContract.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AbstractMessageContract.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.mvp.contracts.message; /** diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AudioMessageContract.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AudioMessageContract.java index adfb276..f14227a 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AudioMessageContract.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/AudioMessageContract.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.mvp.contracts.message; /** diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/ImageMessageContract.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/ImageMessageContract.java index 1e0b696..9766caa 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/ImageMessageContract.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/ImageMessageContract.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.mvp.contracts.message; /** diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/MediaMessageContract.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/MediaMessageContract.java index 2cdf5af..5522075 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/MediaMessageContract.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/MediaMessageContract.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.mvp.contracts.message; /** diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/TextMessageContract.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/TextMessageContract.java index eda67ad..44d0e29 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/TextMessageContract.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/TextMessageContract.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.mvp.contracts.message; /** diff --git a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/VideoMessageContract.java b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/VideoMessageContract.java index 85da400..49303a5 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/VideoMessageContract.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/mvp/contracts/message/VideoMessageContract.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.mvp.contracts.message; /** diff --git a/mobile/src/main/java/de/vanitasvitae/slam/ui/NonPagingViewPager.java b/mobile/src/main/java/de/vanitasvitae/slam/ui/NonPagingViewPager.java index 49b0eb1..0963afa 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/ui/NonPagingViewPager.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/ui/NonPagingViewPager.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.ui; import android.content.Context; diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/Account.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/Account.java new file mode 100644 index 0000000..2a9a04d --- /dev/null +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/Account.java @@ -0,0 +1,24 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +package de.vanitasvitae.slam.xmpp; + +/** + * Created by Paul Schaub on 24.02.18. + */ +public class Account { +} diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/Contact.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/Contact.java index 7e0727c..970df29 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/Contact.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/Contact.java @@ -25,15 +25,17 @@ import org.jxmpp.jid.BareJid; public class Contact { private final BareJid jid; + private final Account account; private String nickname; - public Contact(BareJid jid) { - this(jid, null); + public Contact(BareJid jid, Account account) { + this(jid, account, null); } - public Contact(BareJid jid, String nickname) { + public Contact(BareJid jid, Account account, String nickname) { this.jid = jid; this.nickname = nickname; + this.account = account; } public BareJid getJid() { @@ -43,4 +45,12 @@ public class Contact { public String getNickname() { return nickname; } + + public Account getAccount() { + return account; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } } diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/SentReadMarker.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/SentReadMarker.java index 7b24b81..accc089 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/SentReadMarker.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/SentReadMarker.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.xmpp; /** diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AbstractMessage.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AbstractMessage.java index d11ce41..e1942c0 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AbstractMessage.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AbstractMessage.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.xmpp.message; import org.jxmpp.jid.Jid; diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AudioMessage.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AudioMessage.java index 77c5a93..5e2f984 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AudioMessage.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/AudioMessage.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.xmpp.message; import org.jxmpp.jid.Jid; diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/ImageMessage.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/ImageMessage.java index 8da5310..d8475d4 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/ImageMessage.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/ImageMessage.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.xmpp.message; import org.jxmpp.jid.Jid; diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/MediaMessage.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/MediaMessage.java index b3d2f66..a522620 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/MediaMessage.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/MediaMessage.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.xmpp.message; import org.jxmpp.jid.Jid; diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/TextMessage.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/TextMessage.java index d9b99e3..e270f22 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/TextMessage.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/TextMessage.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.xmpp.message; import org.jxmpp.jid.Jid; diff --git a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/VideoMessage.java b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/VideoMessage.java index 8c5b6a6..85c4cba 100644 --- a/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/VideoMessage.java +++ b/mobile/src/main/java/de/vanitasvitae/slam/xmpp/message/VideoMessage.java @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Paul Schaub + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ package de.vanitasvitae.slam.xmpp.message; import org.jxmpp.jid.Jid;