From 07181b2e4daeade4804d4aa2c955fb564714d21f Mon Sep 17 00:00:00 2001 From: acanas Date: Wed, 3 Mar 2021 22:47:08 +0100 Subject: [PATCH] Version 20.41.5: Mar 03, 2021 Code refactoring in timeline. --- swad_changelog.h | 3 ++- swad_timeline_comment.c | 1 - swad_timeline_favourite.c | 1 - swad_timeline_favourite.h | 3 --- swad_timeline_form.c | 1 - swad_timeline_note.c | 2 -- swad_timeline_publication.c | 14 +++++--------- swad_timeline_share.c | 1 - swad_timeline_share.h | 2 -- 9 files changed, 7 insertions(+), 21 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index df08675b..0250324e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -598,10 +598,11 @@ TODO: DNI de un estudiante sale err TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede. TODO: Salvador Romero Cortés: @acanas opción para editar posts */ -#define Log_PLATFORM_VERSION "SWAD 20.41.4 (2021-03-03)" +#define Log_PLATFORM_VERSION "SWAD 20.41.5 (2021-03-03)" #define CSS_FILE "swad20.33.9.css" #define JS_FILE "swad20.6.2.js" /* + Version 20.41.5: Mar 03, 2021 Code refactoring in timeline. (305569 lines) Version 20.41.4: Mar 03, 2021 Code refactoring in timeline publications. (305577 lines) Version 20.41.3: Mar 03, 2021 Code refactoring in timeline publications. (305580 lines) Version 20.41.2: Mar 03, 2021 Code refactoring in timeline. (305569 lines) diff --git a/swad_timeline_comment.c b/swad_timeline_comment.c index 51f1ce0f..9bbfe0a4 100644 --- a/swad_timeline_comment.c +++ b/swad_timeline_comment.c @@ -36,7 +36,6 @@ #include "swad_profile.h" #include "swad_timeline.h" #include "swad_timeline_database.h" -#include "swad_timeline_favourite.h" #include "swad_timeline_form.h" #include "swad_timeline_note.h" #include "swad_timeline_publication.h" diff --git a/swad_timeline_favourite.c b/swad_timeline_favourite.c index c340a44a..31a31c79 100644 --- a/swad_timeline_favourite.c +++ b/swad_timeline_favourite.c @@ -30,7 +30,6 @@ #include "swad_timeline.h" #include "swad_timeline_database.h" #include "swad_timeline_favourite.h" -#include "swad_timeline_form.h" #include "swad_timeline_notification.h" #include "swad_timeline_publication.h" diff --git a/swad_timeline_favourite.h b/swad_timeline_favourite.h index 21c5d875..e1d4f652 100644 --- a/swad_timeline_favourite.h +++ b/swad_timeline_favourite.h @@ -27,9 +27,6 @@ /********************************** Headers **********************************/ /*****************************************************************************/ -#include "swad_timeline_comment.h" -#include "swad_timeline_note.h" - /*****************************************************************************/ /************************ Public constants and types *************************/ /*****************************************************************************/ diff --git a/swad_timeline_form.c b/swad_timeline_form.c index f070ad96..75036deb 100644 --- a/swad_timeline_form.c +++ b/swad_timeline_form.c @@ -32,7 +32,6 @@ #include "swad_action.h" #include "swad_global.h" #include "swad_timeline.h" -#include "swad_timeline_database.h" #include "swad_timeline_favourite.h" #include "swad_timeline_form.h" #include "swad_timeline_share.h" diff --git a/swad_timeline_note.c b/swad_timeline_note.c index 378a9d75..88134dc2 100644 --- a/swad_timeline_note.c +++ b/swad_timeline_note.c @@ -41,10 +41,8 @@ #include "swad_profile.h" #include "swad_timeline.h" #include "swad_timeline_database.h" -#include "swad_timeline_favourite.h" #include "swad_timeline_form.h" #include "swad_timeline_publication.h" -#include "swad_timeline_share.h" /*****************************************************************************/ /****************************** Public constants *****************************/ diff --git a/swad_timeline_publication.c b/swad_timeline_publication.c index a6a9a046..63378fc8 100644 --- a/swad_timeline_publication.c +++ b/swad_timeline_publication.c @@ -322,6 +322,7 @@ static struct TL_Pub_Publication *TL_Pub_SelectTheMostRecentPub (const struct TL MYSQL_RES *mysql_res; struct TL_Pub_Publication *Pub; + /***** Select the most recent publication from database *****/ if (TL_DB_SelectTheMostRecentPub (SubQueries,&mysql_res) == 1) { /* Allocate space for publication */ @@ -351,7 +352,7 @@ void TL_Pub_InsertNewPubsInTimeline (struct TL_Timeline *Timeline) struct TL_Pub_Publication *Pub; struct TL_Not_Note Not; - /***** List new publications timeline *****/ + /***** List new publications in timeline *****/ for (Pub = Timeline->Pubs.Top; Pub; Pub = Pub->Next) @@ -523,17 +524,11 @@ void TL_Pub_GetDataOfPubFromNextRow (MYSQL_RES *mysql_res, row[2]: PublisherCod row[3]: PubType */ - - /***** Get code of publication (row[0]) *****/ + /***** Get code of publication (row[0]), code of note (row[1]), + publisher's code (row[2]) and type of publication (row[3]) *****/ Pub->PubCod = Str_ConvertStrCodToLongCod (row[0]); - - /***** Get note code (row[1]) *****/ Pub->NotCod = Str_ConvertStrCodToLongCod (row[1]); - - /***** Get publisher's code (row[2]) *****/ Pub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]); - - /***** Get type of publication (row[3]) *****/ Pub->PubType = TL_Pub_GetPubTypeFromStr (row[3]); } @@ -545,6 +540,7 @@ static TL_Pub_PubType_t TL_Pub_GetPubTypeFromStr (const char *Str) { unsigned UnsignedNum; + /***** Get publication type from string *****/ if (sscanf (Str,"%u",&UnsignedNum) == 1) if (UnsignedNum < TL_Pub_NUM_PUB_TYPES) return (TL_Pub_PubType_t) UnsignedNum; diff --git a/swad_timeline_share.c b/swad_timeline_share.c index 46a1f400..31b06efd 100644 --- a/swad_timeline_share.c +++ b/swad_timeline_share.c @@ -29,7 +29,6 @@ #include "swad_global.h" #include "swad_timeline.h" #include "swad_timeline_database.h" -#include "swad_timeline_form.h" #include "swad_timeline_notification.h" #include "swad_timeline_publication.h" #include "swad_timeline_share.h" diff --git a/swad_timeline_share.h b/swad_timeline_share.h index 68f5640f..2563b80b 100644 --- a/swad_timeline_share.h +++ b/swad_timeline_share.h @@ -27,8 +27,6 @@ /********************************** Headers **********************************/ /*****************************************************************************/ -#include "swad_timeline_note.h" - /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/