Commit 8a046053 authored by Thomas's avatar Thomas
Browse files

Add emoji reactions for Pleroma

parent cf1a1b3e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
        binding.toolbarSearch.setOnSearchClickListener(v -> binding.tabLayout.setVisibility(View.VISIBLE));
        //For receiving  data from other activities
        LocalBroadcastManager.getInstance(BaseMainActivity.this).registerReceiver(broadcast_data, new IntentFilter(Helper.BROADCAST_DATA));
        if (emojis == null || !emojis.containsKey(BaseMainActivity.currentInstance)) {
        if (emojis == null || !emojis.containsKey(BaseMainActivity.currentInstance) || emojis.get(BaseMainActivity.currentInstance) == null) {
            new Thread(() -> {
                try {
                    emojis.put(currentInstance, new EmojiInstance(BaseMainActivity.this).getEmojiList(BaseMainActivity.currentInstance));
+40 −0
Original line number Diff line number Diff line
package app.fedilab.android.client.endpoints;
/* Copyright 2022 Thomas Schneider
 *
 * This file is a part of Fedilab
 *
 * 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.
 *
 * Fedilab 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 Fedilab; if not,
 * see <http://www.gnu.org/licenses>. */

import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Header;
import retrofit2.http.PUT;
import retrofit2.http.Path;

public interface PleromaAPI {


    @PUT("pleroma/statuses/{id}/reactions/{name}")
    Call<Void> addReaction(
            @Header("Authorization") String app_token,
            @Path("id") String id,
            @Path("name") String name
    );

    @DELETE("pleroma/statuses/{id}/reactions/{name}")
    Call<Void> removeReaction(
            @Header("Authorization") String app_token,
            @Path("id") String id,
            @Path("name") String name
    );

}
+25 −0
Original line number Diff line number Diff line
package app.fedilab.android.client.entities.api;
/* Copyright 2022 Thomas Schneider
 *
 * This file is a part of Fedilab
 *
 * 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.
 *
 * Fedilab 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 Fedilab; if not,
 * see <http://www.gnu.org/licenses>. */

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;

public class Pleroma implements Serializable {
    @SerializedName("emoji_reactions")
    public List<Reaction> emoji_reactions;
}
+3 −1
Original line number Diff line number Diff line
@@ -16,7 +16,9 @@ package app.fedilab.android.client.entities.api;

import com.google.gson.annotations.SerializedName;

public class Reaction {
import java.io.Serializable;

public class Reaction implements Serializable {
    @SerializedName("name")
    public String name;
    @SerializedName("count")
+2 −0
Original line number Diff line number Diff line
@@ -89,6 +89,8 @@ public class Status implements Serializable, Cloneable {
    public Card card;
    @SerializedName("poll")
    public Poll poll;
    @SerializedName("pleroma")
    public Pleroma pleroma;


    public Attachment art_attachment;
Loading