From 9fd7a2948ea6a797bd641aefca56a0c04f2349c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 24 Feb 2017 11:01:28 +0100 Subject: [PATCH] Version 16.140.3 --- swad_changelog.h | 4 +++- swad_config.h | 2 +- swad_social.c | 40 +++++++++++++++++++++++++++------------- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index b2f2bd70d..47b0ba100 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -204,13 +204,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.140.2 (2017-02-24)" +#define Log_PLATFORM_VERSION "SWAD 16.140.3 (2017-02-24)" #define CSS_FILE "swad16.139.6.css" #define JS_FILE "swad16.140.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* + Version 16.140.3: Feb 24, 2017 Changed refreshing of timeline from 30 to 10 seconds. + Code refactoring in timeline when I do not follow any user. (213006 lines) Version 16.140.2: Feb 24, 2017 Changed text of users to view in global timeline. (212994 lines) Version 16.140.1: Feb 24, 2017 Hidden parameter with users to view in all actions related to global timeline. Code refactoring of forms in social timeline. (212993 lines) diff --git a/swad_config.h b/swad_config.h index f1abf2209..b2e6da5dc 100644 --- a/swad_config.h +++ b/swad_config.h @@ -458,7 +458,7 @@ #define Cfg_TIME_TO_REFRESH_LAST_CLICKS ((time_t)( 1UL * 1000UL)) // Refresh period of last clicks in miliseconds -#define Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE ((time_t)( 30UL * 1000UL)) // Refresh period of social timeline in miliseconds +#define Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE ((time_t)( 10UL * 1000UL)) // Refresh period of social timeline in miliseconds #define Cfg_TIME_TO_CHANGE_BANNER ((time_t)( 2UL * 60UL)) // After these seconds, change banner #define Cfg_NUMBER_OF_BANNERS 1 // Number of banners to show simultaneously diff --git a/swad_social.c b/swad_social.c index 2ac945c29..250dbda09 100644 --- a/swad_social.c +++ b/swad_social.c @@ -154,6 +154,8 @@ static void Soc_PutFormWhichUsrs (void); static void Soc_PutParamWhichUsrs (void); static void Soc_GetParamsWhichUsrs (void); +static void Soc_ShowWarningYouDontFollowAnyUser (void); + static void Soc_InsertNewPubsInTimeline (const char *Query); static void Soc_ShowOldPubsInTimeline (const char *Query); @@ -356,21 +358,8 @@ void Soc_ShowTimelineGbl2 (void) static void Soc_ShowTimelineGblHighlightingNot (long NotCod) { extern const char *Txt_Public_activity; - extern const char *Txt_You_dont_follow_any_user; char Query[1024]; - /***** Check if I follow someone *****/ - if (!Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod)) - { - /***** Put link to show users to follow *****/ - fprintf (Gbl.F.Out,"
"); - Fol_PutLinkWhoToFollow (); - fprintf (Gbl.F.Out,"
"); - - /***** Show warning if I do not follow anyone *****/ - Lay_ShowAlert (Lay_WARNING,Txt_You_dont_follow_any_user); - } - /***** Build query to get timeline *****/ Soc_BuildQueryToGetTimeline (Soc_TIMELINE_GBL, Soc_GET_RECENT_TIMELINE, @@ -1061,6 +1050,10 @@ static void Soc_PutFormWhichUsrs (void) fprintf (Gbl.F.Out,"" ""); Act_FormEnd (); + + /***** Show warning if I do not follow anyone *****/ + if (Gbl.Social.WhichUsrs == Soc_FOLLOWED) + Soc_ShowWarningYouDontFollowAnyUser (); } /*****************************************************************************/ @@ -1086,6 +1079,27 @@ static void Soc_GetParamsWhichUsrs (void) (unsigned long) Soc_DEFAULT_WHICH_USRS); } +/*****************************************************************************/ +/********* Get parameter with which users to view in global timeline *********/ +/*****************************************************************************/ + +static void Soc_ShowWarningYouDontFollowAnyUser (void) + { + extern const char *Txt_You_dont_follow_any_user; + + /***** Check if I follow someone *****/ + if (!Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod)) + { + /***** Show warning if I do not follow anyone *****/ + Lay_ShowAlert (Lay_WARNING,Txt_You_dont_follow_any_user); + + /***** Put link to show users to follow *****/ + fprintf (Gbl.F.Out,"
"); + Fol_PutLinkWhoToFollow (); + fprintf (Gbl.F.Out,"
"); + } + } + /*****************************************************************************/ /********** Show new social activity (new publishings in timeline) ***********/ /*****************************************************************************/