Skip to content
Snippets Groups Projects
Commit fd47bd8d authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Rewrote all Syncables and the structure of the libquassel Client object

Updated README and licenses.
parent 877077d8
No related branches found
No related tags found
No related merge requests found
Showing
with 150 additions and 138 deletions
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.serializers;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.serializers;
......@@ -37,7 +34,7 @@ import de.kuschku.libquassel.functions.types.UnpackedFunction;
import de.kuschku.libquassel.objects.types.SessionState;
import de.kuschku.libquassel.primitives.types.BufferInfo;
import de.kuschku.libquassel.primitives.types.QVariant;
import de.kuschku.libquassel.syncables.types.Identity;
import de.kuschku.libquassel.syncables.types.interfaces.QIdentity;
@SuppressWarnings({"unchecked", "ConstantConditions"})
public class SessionStateSerializer implements ObjectSerializer<SessionState> {
......@@ -68,7 +65,7 @@ public class SessionStateSerializer implements ObjectSerializer<SessionState> {
@Override
public SessionState fromLegacy(@NonNull Map<String, QVariant> map) {
return new SessionState(
(List<Identity>) map.get("Identities").or(new ArrayList<>()),
(List<QIdentity>) map.get("Identities").or(new ArrayList<>()),
(List<BufferInfo>) map.get("BufferInfos").or(new ArrayList<>()),
(List<Integer>) map.get("NetworkIds").or(new ArrayList<>())
);
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.serializers;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.serializers;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.serializers;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,50 +8,25 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.List;
public class ClientInitAck {
public final boolean Configured;
public final boolean LoginEnabled;
public final int CoreFeatures;
@Nullable
public final List<StorageBackend> StorageBackends;
public ClientInitAck(boolean configured, boolean loginEnabled, int coreFeatures,
@Nullable List<StorageBackend> storageBackends) {
Configured = configured;
LoginEnabled = loginEnabled;
CoreFeatures = coreFeatures;
StorageBackends = storageBackends;
}
@NonNull
@Override
public String toString() {
return "ClientInitAck{" +
"Configured=" + Configured +
", LoginEnabled=" + LoginEnabled +
", CoreFeatures=" + CoreFeatures +
", StorageBackends=" + StorageBackends +
'}';
public class ClientInitAck extends CoreStatus {
public ClientInitAck(boolean configured, boolean loginEnabled, int coreFeatures, @Nullable List<StorageBackend> storageBackends) {
super(configured, loginEnabled, coreFeatures, storageBackends);
}
}
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
/*
* QuasselDroid - Quassel client for Android
* Copyright (C) 2016 Janne Koschinski
* Copyright (C) 2016 Ken Børge Viktil
* Copyright (C) 2016 Magnus Fjell
* Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
*
* This program 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, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
import de.kuschku.libquassel.primitives.types.BufferInfo;
public class Command {
public final BufferInfo buffer;
public final String command;
public Command(BufferInfo buffer, String command) {
this.buffer = buffer;
this.command = command;
}
}
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
/*
* QuasselDroid - Quassel client for Android
* Copyright (C) 2016 Janne Koschinski
* Copyright (C) 2016 Ken Børge Viktil
* Copyright (C) 2016 Magnus Fjell
* Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
*
* This program 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, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import java.util.List;
public class CoreStatus {
public final boolean Configured;
public final boolean LoginEnabled;
public final int CoreFeatures;
@Nullable
public final List<StorageBackend> StorageBackends;
public CoreStatus(boolean configured, boolean loginEnabled, int coreFeatures,
@Nullable List<StorageBackend> storageBackends) {
Configured = configured;
LoginEnabled = loginEnabled;
CoreFeatures = coreFeatures;
StorageBackends = storageBackends;
}
@NonNull
@Override
public String toString() {
return "ClientInitAck{" +
"Configured=" + Configured +
", LoginEnabled=" + LoginEnabled +
", CoreFeatures=" + CoreFeatures +
", StorageBackends=" + StorageBackends +
'}';
}
}
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......@@ -29,17 +26,17 @@ import android.support.annotation.NonNull;
import java.util.List;
import de.kuschku.libquassel.primitives.types.BufferInfo;
import de.kuschku.libquassel.syncables.types.Identity;
import de.kuschku.libquassel.syncables.types.interfaces.QIdentity;
public class SessionState {
@NonNull
public final List<Identity> Identities;
public final List<QIdentity> Identities;
@NonNull
public final List<BufferInfo> BufferInfos;
@NonNull
public final List<Integer> NetworkIds;
public SessionState(@NonNull List<Identity> identities, @NonNull List<BufferInfo> bufferInfos,
public SessionState(@NonNull List<QIdentity> identities, @NonNull List<BufferInfo> bufferInfos,
@NonNull List<Integer> networkIds) {
this.Identities = identities;
this.BufferInfos = bufferInfos;
......
......@@ -8,18 +8,15 @@
* This program 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, or under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
* 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 and the
* GNU Lesser General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.libquassel.objects.types;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment