jblanked 1 год назад
Родитель
Сommit
6c507c5f8e
6 измененных файлов с 14 добавлено и 9 удалено
  1. 2 2
      alloc/alloc.c
  2. 1 0
      alloc/alloc.h
  3. 4 4
      callback/flip_social_callback.c
  4. 1 1
      flip_social.h
  5. 3 1
      jsmn/jsmn.c
  6. 3 1
      jsmn/jsmn_furi.c

+ 2 - 2
alloc/alloc.c

@@ -48,7 +48,7 @@ bool messages_dialog_alloc(bool free_first)
                 flip_social_messages->usernames[flip_social_messages->index],
                 0,
                 0,
-                flip_social_messages->messages[flip_social_messages->index],
+                updated_user_message(flip_social_messages->messages[flip_social_messages->index]),
                 0,
                 10,
                 flip_social_messages->index != 0 ? "Prev" : NULL,
@@ -65,7 +65,7 @@ bool messages_dialog_alloc(bool free_first)
     }
     return false;
 }
-static char *updated_user_message(const char *user_message)
+char *updated_user_message(const char *user_message)
 {
     if (user_message == NULL)
     {

+ 1 - 0
alloc/alloc.h

@@ -6,6 +6,7 @@ void auth_headers_alloc(void);
 FlipSocialFeedMini *flip_feed_info_alloc(void);
 bool messages_dialog_alloc(bool free_first);
 bool feed_dialog_alloc();
+char *updated_user_message(const char *user_message);
 bool alloc_text_input(uint32_t view_id);
 bool about_widget_alloc(bool is_logged_in);
 bool alloc_variable_item_list(uint32_t view_id);

+ 4 - 4
callback/flip_social_callback.c

@@ -463,7 +463,7 @@ void messages_dialog_callback(DialogExResult result, void *context)
             flip_social_messages->index--;
             dialog_ex_reset(app->dialog_messages);
             dialog_ex_set_header(app->dialog_messages, flip_social_messages->usernames[flip_social_messages->index], 0, 0, AlignLeft, AlignTop);
-            dialog_ex_set_text(app->dialog_messages, flip_social_messages->messages[flip_social_messages->index], 0, 10, AlignLeft, AlignTop);
+            dialog_ex_set_text(app->dialog_messages, updated_user_message(flip_social_messages->messages[flip_social_messages->index]), 0, 10, AlignLeft, AlignTop);
             if (flip_social_messages->index != 0)
             {
                 dialog_ex_set_left_button_text(app->dialog_messages, "Prev");
@@ -484,7 +484,7 @@ void messages_dialog_callback(DialogExResult result, void *context)
             flip_social_messages->index++;
             dialog_ex_reset(app->dialog_messages);
             dialog_ex_set_header(app->dialog_messages, flip_social_messages->usernames[flip_social_messages->index], 0, 0, AlignLeft, AlignTop);
-            dialog_ex_set_text(app->dialog_messages, flip_social_messages->messages[flip_social_messages->index], 0, 10, AlignLeft, AlignTop);
+            dialog_ex_set_text(app->dialog_messages, updated_user_message(flip_social_messages->messages[flip_social_messages->index]), 0, 10, AlignLeft, AlignTop);
             dialog_ex_set_left_button_text(app->dialog_messages, "Prev");
             if (flip_social_messages->index != flip_social_messages->count - 1)
             {
@@ -958,7 +958,7 @@ void flip_social_callback_submenu_choices(void *context, uint32_t index)
                         "New Feed Post",
                         0,
                         0,
-                        selected_message,
+                        updated_user_message(selected_message),
                         0,
                         10,
                         "Delete",
@@ -1005,7 +1005,7 @@ void flip_social_callback_submenu_choices(void *context, uint32_t index)
                             flip_social_explore->usernames[flip_social_explore->index],
                             0,
                             0,
-                            app->explore_user_bio,
+                            updated_user_message(app->explore_user_bio),
                             0,
                             10,
                             "Remove", // remove if user is a friend (future update)

+ 1 - 1
flip_social.h

@@ -17,7 +17,7 @@
 #define MAX_USER_LENGTH 32        // Maximum length of a username
 #define MAX_FRIENDS 50            // Maximum number of friends
 #define MAX_FEED_ITEMS 50         // Maximum number of feed items
-#define MAX_LINE_LENGTH 30
+#define MAX_LINE_LENGTH 29
 #define MAX_MESSAGE_USERS 40 // Maximum number of users to display in the submenu
 #define MAX_MESSAGES 20      // Maximum number of meesages between each user
 

+ 3 - 1
jsmn/jsmn.c

@@ -508,7 +508,9 @@ char *get_json_value(char *key, const char *json_data)
     {
         FURI_LOG_E("JSMM.H", "JSON data is NULL");
     }
-    FURI_LOG_E("JSMM.H", "Failed to find the key in the JSON.");
+    char warning[128];
+    snprintf(warning, sizeof(warning), "Failed to find the key \"%s\" in the JSON.", key);
+    FURI_LOG_E("JSMM.H", warning);
     return NULL; // Return NULL if something goes wrong
 }
 

+ 3 - 1
jsmn/jsmn_furi.c

@@ -531,7 +531,9 @@ FuriString *get_json_value_furi(const char *key, const FuriString *json_data)
 
     free(tokens);
     furi_string_free(key_str);
-    FURI_LOG_E("JSMM.H", "Failed to find the key in the JSON.");
+    char warning[128];
+    snprintf(warning, sizeof(warning), "Failed to find the key \"%s\" in the JSON.", key);
+    FURI_LOG_E("JSMM.H", warning);
     return NULL;
 }