Просмотр исходного кода

rename flip_social_feed and it's methods

jblanked 9 месяцев назад
Родитель
Сommit
b96f0eb538
5 измененных файлов с 26 добавлено и 26 удалено
  1. 6 6
      alloc/alloc.c
  2. 3 3
      callback/callback.c
  3. 8 8
      feed/feed.c
  4. 9 0
      feed/feed.h
  5. 0 9
      feed/flip_social_feed.h

+ 6 - 6
alloc/alloc.c

@@ -1,6 +1,6 @@
 #include <alloc/alloc.h>
 #include <alloc/alloc.h>
 #include <flip_storage/flip_social_storage.h>
 #include <flip_storage/flip_social_storage.h>
-#include <feed/flip_social_feed.h>
+#include <feed/feed.h>
 
 
 FlipSocialApp *flip_social_app_alloc()
 FlipSocialApp *flip_social_app_alloc()
 {
 {
@@ -802,7 +802,7 @@ static bool flip_social_feed_input_callback(InputEvent *event, void *context)
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
         free_feed_view();
         free_feed_view();
         // load feed item
         // load feed item
-        if (!flip_social_load_feed_post(flip_feed_info->ids[flip_feed_info->index]))
+        if (!feed_load_post(flip_feed_info->ids[flip_feed_info->index]))
         {
         {
             FURI_LOG_E(TAG, "Failed to load nexy feed post");
             FURI_LOG_E(TAG, "Failed to load nexy feed post");
             return false;
             return false;
@@ -836,7 +836,7 @@ static bool flip_social_feed_input_callback(InputEvent *event, void *context)
                 FURI_LOG_E(TAG, "Failed to initialize FlipperHTTP");
                 FURI_LOG_E(TAG, "Failed to initialize FlipperHTTP");
                 return false;
                 return false;
             }
             }
-            if (!flip_social_load_initial_feed(fhttp, flip_feed_info->series_index))
+            if (!feed_load_initial_feed(fhttp, flip_feed_info->series_index))
             {
             {
                 FURI_LOG_E(TAG, "Failed to load initial feed");
                 FURI_LOG_E(TAG, "Failed to load initial feed");
                 flipper_http_free(fhttp);
                 flipper_http_free(fhttp);
@@ -847,7 +847,7 @@ static bool flip_social_feed_input_callback(InputEvent *event, void *context)
             view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
             view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
             free_feed_view();
             free_feed_view();
             // load feed item
             // load feed item
-            if (!flip_social_load_feed_post(flip_feed_info->ids[flip_feed_info->index]))
+            if (!feed_load_post(flip_feed_info->ids[flip_feed_info->index]))
             {
             {
                 FURI_LOG_E(TAG, "Failed to load nexy feed post");
                 FURI_LOG_E(TAG, "Failed to load nexy feed post");
                 return false;
                 return false;
@@ -870,7 +870,7 @@ static bool flip_social_feed_input_callback(InputEvent *event, void *context)
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
         free_feed_view();
         free_feed_view();
         // load feed item
         // load feed item
-        if (!flip_social_load_feed_post(flip_feed_info->ids[flip_feed_info->index]))
+        if (!feed_load_post(flip_feed_info->ids[flip_feed_info->index]))
         {
         {
             FURI_LOG_E(TAG, "Failed to load nexy feed post");
             FURI_LOG_E(TAG, "Failed to load nexy feed post");
             return false;
             return false;
@@ -936,7 +936,7 @@ static bool flip_social_feed_input_callback(InputEvent *event, void *context)
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewWidgetResult);
         free_feed_view();
         free_feed_view();
         // load feed item
         // load feed item
-        if (!flip_social_load_feed_post(flip_feed_info->ids[flip_feed_info->index]))
+        if (!feed_load_post(flip_feed_info->ids[flip_feed_info->index]))
         {
         {
             FURI_LOG_E(TAG, "Failed to load nexy feed post");
             FURI_LOG_E(TAG, "Failed to load nexy feed post");
             fhttp->state = ISSUE;
             fhttp->state = ISSUE;

+ 3 - 3
callback/callback.c

@@ -3,7 +3,7 @@
 #include <messages/flip_social_messages.h>
 #include <messages/flip_social_messages.h>
 #include <friends/flip_social_friends.h>
 #include <friends/flip_social_friends.h>
 #include <explore/explore.h>
 #include <explore/explore.h>
-#include <feed/flip_social_feed.h>
+#include <feed/feed.h>
 #include <flip_storage/flip_social_storage.h>
 #include <flip_storage/flip_social_storage.h>
 #include <free/free.h>
 #include <free/free.h>
 #include <alloc/alloc.h>
 #include <alloc/alloc.h>
@@ -580,7 +580,7 @@ static void compose_dialog_callback(DialogExResult result, void *context)
         {
         {
             furi_delay_ms(100);
             furi_delay_ms(100);
         }
         }
-        if (flip_social_load_initial_feed(false, 1))
+        if (feed_load_initial_feed(fhttp, 1))
         {
         {
             free_compose_dialog();
             free_compose_dialog();
         }
         }
@@ -746,7 +746,7 @@ void callback_submenu_choices(void *context, uint32_t index)
             FURI_LOG_E(TAG, "Failed to allocate FlipperHTTP");
             FURI_LOG_E(TAG, "Failed to allocate FlipperHTTP");
             return;
             return;
         }
         }
-        if (!flip_social_load_initial_feed(fhttp, 1))
+        if (!feed_load_initial_feed(fhttp, 1))
         {
         {
             FURI_LOG_E(TAG, "Failed to load the initial feed");
             FURI_LOG_E(TAG, "Failed to load the initial feed");
             return;
             return;

+ 8 - 8
feed/flip_social_feed.c → feed/feed.c

@@ -1,8 +1,8 @@
-#include "flip_social_feed.h"
+#include <feed/feed.h>
 #include <flip_storage/flip_social_storage.h>
 #include <flip_storage/flip_social_storage.h>
 #include <alloc/alloc.h>
 #include <alloc/alloc.h>
 
 
-bool flip_social_get_feed(FlipperHTTP *fhttp, int series_index)
+bool feed_fetch(FlipperHTTP *fhttp, int series_index)
 {
 {
     if (!app_instance)
     if (!app_instance)
     {
     {
@@ -46,7 +46,7 @@ bool flip_social_get_feed(FlipperHTTP *fhttp, int series_index)
     return true;
     return true;
 }
 }
 
 
-FlipSocialFeedMini *flip_social_parse_json_feed(FlipperHTTP *fhttp)
+FlipSocialFeedMini *feed_parse_json(FlipperHTTP *fhttp)
 {
 {
     if (!app_instance)
     if (!app_instance)
     {
     {
@@ -118,7 +118,7 @@ FlipSocialFeedMini *flip_social_parse_json_feed(FlipperHTTP *fhttp)
     return feed_info;
     return feed_info;
 }
 }
 
 
-bool flip_social_load_feed_post(int post_id)
+bool feed_load_post(int post_id)
 {
 {
     char file_path[128];
     char file_path[128];
     snprintf(file_path, sizeof(file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_social/feed/feed_post_%d.json", post_id);
     snprintf(file_path, sizeof(file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_social/feed/feed_post_%d.json", post_id);
@@ -193,7 +193,7 @@ bool flip_social_load_feed_post(int post_id)
     return true;
     return true;
 }
 }
 
 
-bool flip_social_load_initial_feed(FlipperHTTP *fhttp, int series_index)
+bool feed_load_initial_feed(FlipperHTTP *fhttp, int series_index)
 {
 {
     if (!app_instance)
     if (!app_instance)
     {
     {
@@ -220,7 +220,7 @@ bool flip_social_load_initial_feed(FlipperHTTP *fhttp, int series_index)
     }
     }
     view_dispatcher_add_view(app_instance->view_dispatcher, loading_view_id, loading_get_view(loading));
     view_dispatcher_add_view(app_instance->view_dispatcher, loading_view_id, loading_get_view(loading));
     view_dispatcher_switch_to_view(app_instance->view_dispatcher, loading_view_id);
     view_dispatcher_switch_to_view(app_instance->view_dispatcher, loading_view_id);
-    if (flip_social_get_feed(fhttp, series_index)) // start the async request
+    if (feed_fetch(fhttp, series_index)) // start the async request
     {
     {
         furi_timer_start(fhttp->get_timeout_timer, TIMEOUT_DURATION_TICKS);
         furi_timer_start(fhttp->get_timeout_timer, TIMEOUT_DURATION_TICKS);
         fhttp->state = RECEIVING;
         fhttp->state = RECEIVING;
@@ -242,7 +242,7 @@ bool flip_social_load_initial_feed(FlipperHTTP *fhttp, int series_index)
     furi_timer_stop(fhttp->get_timeout_timer);
     furi_timer_stop(fhttp->get_timeout_timer);
 
 
     // load feed info
     // load feed info
-    flip_feed_info = flip_social_parse_json_feed(fhttp);
+    flip_feed_info = feed_parse_json(fhttp);
     if (!flip_feed_info || flip_feed_info->count < 1)
     if (!flip_feed_info || flip_feed_info->count < 1)
     {
     {
         FURI_LOG_E(TAG, "Failed to parse JSON feed");
         FURI_LOG_E(TAG, "Failed to parse JSON feed");
@@ -253,7 +253,7 @@ bool flip_social_load_initial_feed(FlipperHTTP *fhttp, int series_index)
     }
     }
 
 
     // load the current feed post
     // load the current feed post
-    if (!flip_social_load_feed_post(flip_feed_info->ids[flip_feed_info->index]))
+    if (!feed_load_post(flip_feed_info->ids[flip_feed_info->index]))
     {
     {
         FURI_LOG_E(TAG, "Failed to load feed post");
         FURI_LOG_E(TAG, "Failed to load feed post");
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewLoggedInSubmenu);
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipSocialViewLoggedInSubmenu);

+ 9 - 0
feed/feed.h

@@ -0,0 +1,9 @@
+#ifndef FLIP_SOCIAL_FEED_H
+#define FLIP_SOCIAL_FEED_H
+#include "flip_social.h"
+
+bool feed_fetch(FlipperHTTP *fhttp, int series_index);
+FlipSocialFeedMini *feed_parse_json(FlipperHTTP *fhttp);
+bool feed_load_post(int post_id);
+bool feed_load_initial_feed(FlipperHTTP *fhttp, int series_index);
+#endif

+ 0 - 9
feed/flip_social_feed.h

@@ -1,9 +0,0 @@
-#ifndef FLIP_SOCIAL_FEED_H
-#define FLIP_SOCIAL_FEED_H
-#include "flip_social.h"
-
-bool flip_social_get_feed(FlipperHTTP *fhttp, int series_index);
-FlipSocialFeedMini *flip_social_parse_json_feed(FlipperHTTP *fhttp);
-bool flip_social_load_feed_post(int post_id);
-bool flip_social_load_initial_feed(FlipperHTTP *fhttp, int series_index);
-#endif