]> www.infradead.org Git - pidgin-chime.git/commitdiff
Added a new 'video' indicator
authorAhmet Ipkin <ipkiahme@amazon.com>
Thu, 11 Mar 2021 09:19:37 +0000 (10:19 +0100)
committerAhmet Ipkin <ipkiahme@amazon.com>
Thu, 11 Mar 2021 09:19:42 +0000 (10:19 +0100)
Also added a 'ping' handled for video; but it seems harmless and without
any affect :)

chime/chime-call-screen.c
chime/chime-call.c
chime/chime-call.h
chime/chime-juggernaut.c
prpl/chat.c

index 939fc243751b412bcc8e086ad95cb25d5f4fef6e..937c737720b2abb1aa27a27d8dbb00a32c49be13 100644 (file)
@@ -160,6 +160,10 @@ static void on_screenws_message(SoupWebsocketConnection *ws, gint type,
                screen_send_packet(screen, SCREEN_PKT_TYPE_HEARTBEAT_RESPONSE, NULL, 0);
                break;
 
+       case SCREEN_PKT_TYPE_PING_REQUEST:
+               screen_send_packet(screen, SCREEN_PKT_TYPE_PING_RESPONSE, NULL, 0);
+               break;
+
        case SCREEN_PKT_TYPE_KEY_REQUEST:
                if (screen->screen_sink) {
                        screen->viewer_present = 1;
index d203bed88cb8a0742172e5b1152008c4205b6420..bb8e9b486d0b4ded5874fc0a6c65b24d3110540d 100644 (file)
@@ -346,7 +346,7 @@ static void free_participant(void *_p)
 static gboolean parse_participant(ChimeConnection *cxn, ChimeCall *call, JsonNode *p,
                                  ChimeCallParticipant **presenter)
 {
-       const gchar *participant_id, *full_name, *participant_type;
+       const gchar *participant_id, *full_name, *participant_type, *video_present;
        gboolean pots, speaker;
        ChimeCallParticipationStatus status;
 
@@ -355,7 +355,8 @@ static gboolean parse_participant(ChimeConnection *cxn, ChimeCall *call, JsonNod
            !parse_string(p, "participant_type", &participant_type) ||
            !parse_call_participation_status(p, "status", &status) ||
            !parse_boolean(p, "pots?", &pots) ||
-           !parse_boolean(p, "speaker?", &speaker))
+           !parse_boolean(p, "speaker?", &speaker) ||
+           !parse_string(p, "video_indicator", &video_present))
                return FALSE;
 
        const gchar *email = NULL;
@@ -380,6 +381,11 @@ static gboolean parse_participant(ChimeConnection *cxn, ChimeCall *call, JsonNod
        cp->status = status;
        cp->shared_screen = screen;
 
+       if(!strcmp(video_present, "none"))
+               cp->video_present = FALSE;
+       else
+               cp->video_present = TRUE;
+
        if (screen == CHIME_SHARED_SCREEN_PRESENTING)
                *presenter = cp;
 
index 35a706f383c80b2fe559601d5f14ac6c644a426f..b8bc41ea43b43cdddce899fabe8c97c4a5f78e4a 100644 (file)
@@ -87,6 +87,7 @@ typedef struct {
        gboolean admin;
        gboolean speaker;
        gboolean pots;
+       gboolean video_present;
        int volume;
        int signal_strength;
        char *passcode;
@@ -99,6 +100,7 @@ typedef struct _ChimeCallAudio ChimeCallAudio;
 
 struct _ChimeCallScreen;
 typedef struct _ChimeCallScreen ChimeCallScreen;
+typedef struct _ChimeWebcamScreen ChimeWebcamScreen;
 
 
 void chime_call_emit_participants(ChimeCall *call);
index 0cecd6652861f01c213209a91438551c8bf3a4b1..becd4eaefb5f38f59b25d5a0cdcb3ea5611fba2a 100644 (file)
@@ -20,6 +20,8 @@
 #include <glib/gi18n.h>
 #include <glib/glist.h>
 
+#include <json-glib/json-glib.h>
+
 #include "chime-connection-private.h"
 
 #include <libsoup/soup.h>
index 944633a387468e11c48ca35255b95431e996e2d2..09086291e7ba20a1cf28e10244710657afd56cf9 100644 (file)
@@ -71,6 +71,7 @@ struct chime_chat {
 
        void *share_select_ui;
        PurpleMedia *share_media;
+       PurpleMedia *webcam_media;
 };
 
 /*
@@ -262,6 +263,8 @@ static PurpleNotifySearchResults *generate_sr_participants(GHashTable *participa
        purple_notify_searchresults_column_add(results, column);
        column = purple_notify_searchresults_column_new("🔊");
        purple_notify_searchresults_column_add(results, column);
+       column = purple_notify_searchresults_column_new("📞/🎥");
+       purple_notify_searchresults_column_add(results, column);
 
        purple_notify_searchresults_button_add(results, PURPLE_NOTIFY_BUTTON_IM, open_participant_im);
 
@@ -298,6 +301,15 @@ static PurpleNotifySearchResults *generate_sr_participants(GHashTable *participa
                        vol_icon = "🔊";
                row = g_list_append(row, g_strdup(vol_icon));
 
+               const gchar *video_or_phone_icon;
+               if (p->video_present == TRUE)
+                       video_or_phone_icon = "🎥";
+               else if (p->pots == TRUE)
+                       video_or_phone_icon = "📞";
+               else
+                       video_or_phone_icon = "";
+               row = g_list_append(row, g_strdup(video_or_phone_icon));
+
                purple_notify_searchresults_row_add(results, row);
 
                pl = g_list_remove(pl, p);