Version 20.40.3: Mar 03, 2021 Code refactoring in timeline.

This commit is contained in:
acanas 2021-03-03 10:48:23 +01:00
parent dca0e83339
commit dd6a4a7357
13 changed files with 117 additions and 103 deletions

View File

@ -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: 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 TODO: Salvador Romero Cortés: @acanas opción para editar posts
*/ */
#define Log_PLATFORM_VERSION "SWAD 20.40.2 (2021-03-03)" #define Log_PLATFORM_VERSION "SWAD 20.40.3 (2021-03-03)"
#define CSS_FILE "swad20.33.9.css" #define CSS_FILE "swad20.33.9.css"
#define JS_FILE "swad20.6.2.js" #define JS_FILE "swad20.6.2.js"
/* /*
Version 20.40.3: Mar 03, 2021 Code refactoring in timeline. (305528 lines)
Version 20.40.2: Mar 03, 2021 Code refactoring in fav/share timeline. (305519 lines) Version 20.40.2: Mar 03, 2021 Code refactoring in fav/share timeline. (305519 lines)
Version 20.40.1: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines) Version 20.40.1: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines)
Version 20.40: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines) Version 20.40: Mar 03, 2021 Code refactoring in fav/share timeline. (305532 lines)

View File

@ -71,10 +71,10 @@ const char *Ntf_WSNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "unknown", [Ntf_EVENT_UNKNOWN ] = "unknown",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TIMELINE_COMMENT ] = "timelineComment", [Ntf_EVENT_TL_COMMENT ] = "timelineComment",
[Ntf_EVENT_TIMELINE_FAV ] = "timelineFav", [Ntf_EVENT_TL_FAV ] = "timelineFav",
[Ntf_EVENT_TIMELINE_SHARE ] = "timelineShare", [Ntf_EVENT_TL_SHARE ] = "timelineShare",
[Ntf_EVENT_TIMELINE_MENTION ] = "timelineMention", [Ntf_EVENT_TL_MENTION ] = "timelineMention",
[Ntf_EVENT_FOLLOWER ] = "follower", [Ntf_EVENT_FOLLOWER ] = "follower",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -109,10 +109,10 @@ static const Act_Action_t Ntf_DefaultActions[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = ActUnk, [Ntf_EVENT_UNKNOWN ] = ActUnk,
/* Start tab */ /* Start tab */
[Ntf_EVENT_TIMELINE_COMMENT ] = ActSeeGblTL, [Ntf_EVENT_TL_COMMENT ] = ActSeeGblTL,
[Ntf_EVENT_TIMELINE_FAV ] = ActSeeGblTL, [Ntf_EVENT_TL_FAV ] = ActSeeGblTL,
[Ntf_EVENT_TIMELINE_SHARE ] = ActSeeGblTL, [Ntf_EVENT_TL_SHARE ] = ActSeeGblTL,
[Ntf_EVENT_TIMELINE_MENTION ] = ActSeeGblTL, [Ntf_EVENT_TL_MENTION ] = ActSeeGblTL,
[Ntf_EVENT_FOLLOWER ] = ActSeeFlr, [Ntf_EVENT_FOLLOWER ] = ActSeeFlr,
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -152,10 +152,10 @@ static const char *Ntf_ParamNotifMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "NotifyNtfEventUnknown", [Ntf_EVENT_UNKNOWN ] = "NotifyNtfEventUnknown",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TIMELINE_COMMENT ] = "NotifyNtfEventTimelineComment", [Ntf_EVENT_TL_COMMENT ] = "NotifyNtfEventTimelineComment",
[Ntf_EVENT_TIMELINE_FAV ] = "NotifyNtfEventTimelineFav", [Ntf_EVENT_TL_FAV ] = "NotifyNtfEventTimelineFav",
[Ntf_EVENT_TIMELINE_SHARE ] = "NotifyNtfEventTimelineShare", [Ntf_EVENT_TL_SHARE ] = "NotifyNtfEventTimelineShare",
[Ntf_EVENT_TIMELINE_MENTION ] = "NotifyNtfEventTimelineMention", [Ntf_EVENT_TL_MENTION ] = "NotifyNtfEventTimelineMention",
[Ntf_EVENT_FOLLOWER ] = "NotifyNtfEventFollower", [Ntf_EVENT_FOLLOWER ] = "NotifyNtfEventFollower",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -191,10 +191,10 @@ static const char *Ntf_ParamEmailMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "EmailNtfEventUnknown", [Ntf_EVENT_UNKNOWN ] = "EmailNtfEventUnknown",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TIMELINE_COMMENT ] = "EmailNtfEventTimelineComment", [Ntf_EVENT_TL_COMMENT ] = "EmailNtfEventTimelineComment",
[Ntf_EVENT_TIMELINE_FAV ] = "EmailNtfEventTimelineFav", [Ntf_EVENT_TL_FAV ] = "EmailNtfEventTimelineFav",
[Ntf_EVENT_TIMELINE_SHARE ] = "EmailNtfEventTimelineShare", [Ntf_EVENT_TL_SHARE ] = "EmailNtfEventTimelineShare",
[Ntf_EVENT_TIMELINE_MENTION ] = "EmailNtfEventTimelineMention", [Ntf_EVENT_TL_MENTION ] = "EmailNtfEventTimelineMention",
[Ntf_EVENT_FOLLOWER ] = "EmailNtfEventSocialFollower", [Ntf_EVENT_FOLLOWER ] = "EmailNtfEventSocialFollower",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -230,10 +230,10 @@ static const char *Ntf_Icons[Ntf_NUM_NOTIFY_EVENTS] =
{ {
[Ntf_EVENT_UNKNOWN ] = "question.svg", [Ntf_EVENT_UNKNOWN ] = "question.svg",
/* Start tab */ /* Start tab */
[Ntf_EVENT_TIMELINE_COMMENT ] = "comment-dots.svg", [Ntf_EVENT_TL_COMMENT ] = "comment-dots.svg",
[Ntf_EVENT_TIMELINE_FAV ] = "star.svg", [Ntf_EVENT_TL_FAV ] = "star.svg",
[Ntf_EVENT_TIMELINE_SHARE ] = "share-alt.svg", [Ntf_EVENT_TL_SHARE ] = "share-alt.svg",
[Ntf_EVENT_TIMELINE_MENTION ] = "at.svg", [Ntf_EVENT_TL_MENTION ] = "at.svg",
[Ntf_EVENT_FOLLOWER ] = "user-plus.svg", [Ntf_EVENT_FOLLOWER ] = "user-plus.svg",
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -719,10 +719,10 @@ static bool Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent,
Brw_PutHiddenParamFilCod (FileMetadata.FilCod); Brw_PutHiddenParamFilCod (FileMetadata.FilCod);
} }
break; break;
case Ntf_EVENT_TIMELINE_COMMENT: case Ntf_EVENT_TL_COMMENT:
case Ntf_EVENT_TIMELINE_FAV: case Ntf_EVENT_TL_FAV:
case Ntf_EVENT_TIMELINE_SHARE: case Ntf_EVENT_TL_SHARE:
case Ntf_EVENT_TIMELINE_MENTION: case Ntf_EVENT_TL_MENTION:
// Cod is the code of the social publishing // Cod is the code of the social publishing
Frm_BeginForm (ActSeeGblTL); Frm_BeginForm (ActSeeGblTL);
TL_Pub_PutHiddenParamPubCod (Cod); TL_Pub_PutHiddenParamPubCod (Cod);
@ -872,10 +872,10 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
case Ntf_EVENT_ENROLMENT_REQUEST: case Ntf_EVENT_ENROLMENT_REQUEST:
Enr_GetNotifEnrolmentRequest (SummaryStr,ContentStr,Cod,GetContent); Enr_GetNotifEnrolmentRequest (SummaryStr,ContentStr,Cod,GetContent);
break; break;
case Ntf_EVENT_TIMELINE_COMMENT: case Ntf_EVENT_TL_COMMENT:
case Ntf_EVENT_TIMELINE_FAV: case Ntf_EVENT_TL_FAV:
case Ntf_EVENT_TIMELINE_SHARE: case Ntf_EVENT_TL_SHARE:
case Ntf_EVENT_TIMELINE_MENTION: case Ntf_EVENT_TL_MENTION:
// Cod is the code of the social publishing // Cod is the code of the social publishing
TL_Ntf_GetNotifPublication (SummaryStr,ContentStr,Cod,GetContent); TL_Ntf_GetNotifPublication (SummaryStr,ContentStr,Cod,GetContent);
break; break;
@ -1291,7 +1291,7 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
Sco_GetDBStrFromScope (Hie_Lvl_DEG),Gbl.Hierarchy.Deg.DegCod, Sco_GetDBStrFromScope (Hie_Lvl_DEG),Gbl.Hierarchy.Deg.DegCod,
Gbl.Usrs.Me.UsrDat.UsrCod); Gbl.Usrs.Me.UsrDat.UsrCod);
break; break;
case Ntf_EVENT_TIMELINE_COMMENT: // New comment to one of my social notes or comments case Ntf_EVENT_TL_COMMENT: // New comment to one of my social notes or comments
// Cod is the code of the social publishing // Cod is the code of the social publishing
NumRows = DB_QuerySELECT (&mysql_res,"can not get users" NumRows = DB_QuerySELECT (&mysql_res,"can not get users"
" to be notified", " to be notified",
@ -1302,9 +1302,9 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
" AND PublisherCod<>%ld", " AND PublisherCod<>%ld",
Cod,Gbl.Usrs.Me.UsrDat.UsrCod); Cod,Gbl.Usrs.Me.UsrDat.UsrCod);
break; break;
case Ntf_EVENT_TIMELINE_FAV: // New favourite to one of my social notes or comments case Ntf_EVENT_TL_FAV: // New favourite to one of my social notes or comments
case Ntf_EVENT_TIMELINE_SHARE: // New sharing of one of my social notes case Ntf_EVENT_TL_SHARE: // New sharing of one of my social notes
case Ntf_EVENT_TIMELINE_MENTION: case Ntf_EVENT_TL_MENTION:
case Ntf_EVENT_FOLLOWER: case Ntf_EVENT_FOLLOWER:
// This function should not be called in these cases // This function should not be called in these cases
return 0; return 0;
@ -1692,10 +1692,10 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
switch (NotifyEvent) switch (NotifyEvent)
{ {
case Ntf_EVENT_UNKNOWN: case Ntf_EVENT_UNKNOWN:
case Ntf_EVENT_TIMELINE_COMMENT: case Ntf_EVENT_TL_COMMENT:
case Ntf_EVENT_TIMELINE_FAV: case Ntf_EVENT_TL_FAV:
case Ntf_EVENT_TIMELINE_SHARE: case Ntf_EVENT_TL_SHARE:
case Ntf_EVENT_TIMELINE_MENTION: case Ntf_EVENT_TL_MENTION:
case Ntf_EVENT_FOLLOWER: case Ntf_EVENT_FOLLOWER:
break; break;
case Ntf_EVENT_DOCUMENT_FILE: case Ntf_EVENT_DOCUMENT_FILE:

View File

@ -55,10 +55,10 @@ typedef enum // TODO: Change numbers (also in database)!!!!!!!!!!!!!!
{ {
Ntf_EVENT_UNKNOWN = 0, Ntf_EVENT_UNKNOWN = 0,
/* Start tab */ /* Start tab */
Ntf_EVENT_TIMELINE_COMMENT = 10, // New comment to one of my social publishings (notes or comments) Ntf_EVENT_TL_COMMENT = 10, // New comment to one of my social publishings (notes or comments)
Ntf_EVENT_TIMELINE_FAV = 11, // New fav of one of my social publishings (notes or comments) Ntf_EVENT_TL_FAV = 11, // New fav of one of my social publishings (notes or comments)
Ntf_EVENT_TIMELINE_SHARE = 12, // New sharing of one of my social notes Ntf_EVENT_TL_SHARE = 12, // New sharing of one of my social notes
Ntf_EVENT_TIMELINE_MENTION = 13, // New mention Ntf_EVENT_TL_MENTION = 13, // New mention
Ntf_EVENT_FOLLOWER = 14, Ntf_EVENT_FOLLOWER = 14,
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */

View File

@ -749,11 +749,11 @@ void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const char *T
Usr_GetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS); Usr_GetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS);
/* Create notification for the mentioned user *****/ /* Create notification for the mentioned user *****/
CreateNotif = (UsrDat.NtfEvents.CreateNotif & (1 << Ntf_EVENT_TIMELINE_MENTION)); CreateNotif = (UsrDat.NtfEvents.CreateNotif & (1 << Ntf_EVENT_TL_MENTION));
if (CreateNotif) if (CreateNotif)
{ {
NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TIMELINE_MENTION)); NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TL_MENTION));
Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_TIMELINE_MENTION,&UsrDat,PubCod, Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_TL_MENTION,&UsrDat,PubCod,
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL : (Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
0), 0),
Gbl.Hierarchy.Ins.InsCod, Gbl.Hierarchy.Ins.InsCod,

View File

@ -27898,7 +27898,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novos pedidos de inscri&ccedil;&atilde;o" "Novos pedidos de inscri&ccedil;&atilde;o"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_COMMENT] = [Ntf_EVENT_TL_COMMENT] =
#if L==1 // ca #if L==1 // ca
"Nous comentaris als meus missatges socials" "Nous comentaris als meus missatges socials"
#elif L==2 // de #elif L==2 // de
@ -27919,7 +27919,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novos coment&aacute;rio &agrave;s minhos posts sociais" "Novos coment&aacute;rio &agrave;s minhos posts sociais"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_FAV] = [Ntf_EVENT_TL_FAV] =
#if L==1 // ca #if L==1 // ca
"Nous favorits als meus missatges socials" "Nous favorits als meus missatges socials"
#elif L==2 // de #elif L==2 // de
@ -27940,7 +27940,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novos favoritos &agrave;s minhos posts sociais" "Novos favoritos &agrave;s minhos posts sociais"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_SHARE] = [Ntf_EVENT_TL_SHARE] =
#if L==1 // ca #if L==1 // ca
"Noves comparticions dels meus missatges socials" "Noves comparticions dels meus missatges socials"
#elif L==2 // de #elif L==2 // de
@ -27961,7 +27961,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
"Novas partilhas de minhos posts sociais" "Novas partilhas de minhos posts sociais"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_MENTION] = [Ntf_EVENT_TL_MENTION] =
#if L==1 // ca #if L==1 // ca
"Noves mencions" "Noves mencions"
#elif L==2 // de #elif L==2 // de
@ -28342,7 +28342,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Pedido de inscri&ccedil;&atilde;o" "Pedido de inscri&ccedil;&atilde;o"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_COMMENT] = [Ntf_EVENT_TL_COMMENT] =
#if L==1 // ca #if L==1 // ca
"Comentari a un missatge social" "Comentari a un missatge social"
#elif L==2 // de #elif L==2 // de
@ -28363,7 +28363,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Coment&aacute;rio a um post sociais" "Coment&aacute;rio a um post sociais"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_FAV] = [Ntf_EVENT_TL_FAV] =
#if L==1 // ca #if L==1 // ca
"Missatge social marcat com favorit" "Missatge social marcat com favorit"
#elif L==2 // de #elif L==2 // de
@ -28384,7 +28384,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Post sociais marcado como favorito" "Post sociais marcado como favorito"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_SHARE] = [Ntf_EVENT_TL_SHARE] =
#if L==1 // ca #if L==1 // ca
"Missatge social compartit" "Missatge social compartit"
#elif L==2 // de #elif L==2 // de
@ -28405,7 +28405,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
"Post sociais compartido" "Post sociais compartido"
#endif #endif
, ,
[Ntf_EVENT_TIMELINE_MENTION] = [Ntf_EVENT_TL_MENTION] =
#if L==1 // ca #if L==1 // ca
"Menci&oacute;" "Menci&oacute;"
#elif L==2 // de #elif L==2 // de

View File

@ -534,7 +534,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowe prosby o rejestracji", [Lan_LANGUAGE_PL ] = "Nowe prosby o rejestracji",
[Lan_LANGUAGE_PT ] = "Novo pedido de inscrição", [Lan_LANGUAGE_PT ] = "Novo pedido de inscrição",
}, },
[Ntf_EVENT_TIMELINE_COMMENT] = [Ntf_EVENT_TL_COMMENT] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nou comentari a un missatge social", [Lan_LANGUAGE_CA ] = "Nou comentari a un missatge social",
@ -547,7 +547,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowy komentarz do post spoleczna", [Lan_LANGUAGE_PL ] = "Nowy komentarz do post spoleczna",
[Lan_LANGUAGE_PT ] = "Novo comentário a um post sociais", [Lan_LANGUAGE_PT ] = "Novo comentário a um post sociais",
}, },
[Ntf_EVENT_TIMELINE_FAV] = [Ntf_EVENT_TL_FAV] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nou favorit a un missatge social", [Lan_LANGUAGE_CA ] = "Nou favorit a un missatge social",
@ -560,7 +560,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowy ulubiony do post spoleczna", [Lan_LANGUAGE_PL ] = "Nowy ulubiony do post spoleczna",
[Lan_LANGUAGE_PT ] = "Novo favorito a um post sociais", [Lan_LANGUAGE_PT ] = "Novo favorito a um post sociais",
}, },
[Ntf_EVENT_TIMELINE_SHARE] = [Ntf_EVENT_TL_SHARE] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nova compartició de missatge social", [Lan_LANGUAGE_CA ] = "Nova compartició de missatge social",
@ -573,7 +573,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR_NO_HTML[Ntf_NUM_NOTIFY_EVENTS][1 + Lan_NU
[Lan_LANGUAGE_PL ] = "Nowy podzial post spoleczna", [Lan_LANGUAGE_PL ] = "Nowy podzial post spoleczna",
[Lan_LANGUAGE_PT ] = "Nova partilha de post sociais", [Lan_LANGUAGE_PT ] = "Nova partilha de post sociais",
}, },
[Ntf_EVENT_TIMELINE_MENTION] = [Ntf_EVENT_TL_MENTION] =
{ {
[Lan_LANGUAGE_UNKNOWN] = "", [Lan_LANGUAGE_UNKNOWN] = "",
[Lan_LANGUAGE_CA ] = "Nova menció", [Lan_LANGUAGE_CA ] = "Nova menció",

View File

@ -775,7 +775,7 @@ static long TL_Com_ReceiveComm (void)
TL_DB_InsertCommContent (Pub.PubCod,&Content); TL_DB_InsertCommContent (Pub.PubCod,&Content);
/***** Store notifications about the new comment *****/ /***** Store notifications about the new comment *****/
Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TIMELINE_COMMENT,Pub.PubCod); Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_TL_COMMENT,Pub.PubCod);
/***** Analyze content and store notifications about mentions *****/ /***** Analyze content and store notifications about mentions *****/
Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt); Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt);
@ -1003,9 +1003,9 @@ void TL_Com_RemoveCommMediaAndDBEntries (long PubCod)
Med_RemoveMedia (TL_DB_GetMedCodFromComm (PubCod)); Med_RemoveMedia (TL_DB_GetMedCodFromComm (PubCod));
/***** Mark possible notifications on this comment as removed *****/ /***** Mark possible notifications on this comment as removed *****/
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_COMMENT,PubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_COMMENT,PubCod);
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV ,PubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod);
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_MENTION,PubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod);
/***** Remove favs for this comment *****/ /***** Remove favs for this comment *****/
TL_DB_RemoveCommFavs (PubCod); TL_DB_RemoveCommFavs (PubCod);

View File

@ -63,7 +63,7 @@ static void TL_Fav_FavComm (struct TL_Com_Comment *Com);
static void TL_Fav_UnfComm (struct TL_Com_Comment *Com); static void TL_Fav_UnfComm (struct TL_Com_Comment *Com);
/*****************************************************************************/ /*****************************************************************************/
/********************** Mark/unmark a note as favourite **********************/ /************************** Show all favers of a note ************************/
/*****************************************************************************/ /*****************************************************************************/
void TL_Fav_ShowAllFaversNoteUsr (void) void TL_Fav_ShowAllFaversNoteUsr (void)
@ -89,6 +89,10 @@ void TL_Fav_ShowAllFaversNoteGbl (void)
TL_Usr_SHOW_ALL_USRS); TL_Usr_SHOW_ALL_USRS);
} }
/*****************************************************************************/
/********************** Mark/unmark a note as favourite **********************/
/*****************************************************************************/
void TL_Fav_FavNoteUsr (void) void TL_Fav_FavNoteUsr (void)
{ {
/***** Get user whom profile is displayed *****/ /***** Get user whom profile is displayed *****/
@ -161,8 +165,7 @@ static void TL_Fav_FavNote (struct TL_Not_Note *Not)
for the author of the post *****/ for the author of the post *****/
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod); OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0) if (OriginalPubCod > 0)
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod, TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_FAV);
Ntf_EVENT_TIMELINE_FAV);
} }
static void TL_Fav_UnfNote (struct TL_Not_Note *Not) static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
@ -192,11 +195,11 @@ static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
/***** Mark possible notifications on this note as removed *****/ /***** Mark possible notifications on this note as removed *****/
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod); OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0) if (OriginalPubCod > 0)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,OriginalPubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,OriginalPubCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/********************* Mark/unmark a comment as favourite ********************/ /************************** Show all favers of a note ************************/
/*****************************************************************************/ /*****************************************************************************/
void TL_Fav_ShowAllFaversComUsr (void) void TL_Fav_ShowAllFaversComUsr (void)
@ -224,6 +227,10 @@ void TL_Fav_ShowAllFaversComGbl (void)
TL_Usr_SHOW_ALL_USRS); TL_Usr_SHOW_ALL_USRS);
} }
/*****************************************************************************/
/********************* Mark/unmark a comment as favourite ********************/
/*****************************************************************************/
void TL_Fav_FavCommUsr (void) void TL_Fav_FavCommUsr (void)
{ {
/***** Get user whom profile is displayed *****/ /***** Get user whom profile is displayed *****/
@ -301,8 +308,7 @@ static void TL_Fav_FavComm (struct TL_Com_Comment *Com)
/***** Create notification about favourite post /***** Create notification about favourite post
for the author of the post *****/ for the author of the post *****/
TL_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod, TL_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TL_FAV);
Ntf_EVENT_TIMELINE_FAV);
/***** Free image *****/ /***** Free image *****/
Med_MediaDestructor (&Com->Content.Media); Med_MediaDestructor (&Com->Content.Media);
@ -340,7 +346,7 @@ static void TL_Fav_UnfComm (struct TL_Com_Comment *Com)
Com->PubCod,Com->UsrCod); Com->PubCod,Com->UsrCod);
/***** Mark possible notifications on this comment as removed *****/ /***** Mark possible notifications on this comment as removed *****/
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,Com->PubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV,Com->PubCod);
/***** Free image *****/ /***** Free image *****/
Med_MediaDestructor (&Com->Content.Media); Med_MediaDestructor (&Com->Content.Media);

View File

@ -126,10 +126,10 @@ void TL_Not_ShowHighlightedNote (struct TL_Timeline *Timeline,
{ {
[Ntf_EVENT_UNKNOWN ] = TL_TOP_MESSAGE_NONE, [Ntf_EVENT_UNKNOWN ] = TL_TOP_MESSAGE_NONE,
/* Start tab */ /* Start tab */
[Ntf_EVENT_TIMELINE_COMMENT ] = TL_TOP_MESSAGE_COMMENTED, [Ntf_EVENT_TL_COMMENT ] = TL_TOP_MESSAGE_COMMENTED,
[Ntf_EVENT_TIMELINE_FAV ] = TL_TOP_MESSAGE_FAVED, [Ntf_EVENT_TL_FAV ] = TL_TOP_MESSAGE_FAVED,
[Ntf_EVENT_TIMELINE_SHARE ] = TL_TOP_MESSAGE_SHARED, [Ntf_EVENT_TL_SHARE ] = TL_TOP_MESSAGE_SHARED,
[Ntf_EVENT_TIMELINE_MENTION ] = TL_TOP_MESSAGE_MENTIONED, [Ntf_EVENT_TL_MENTION ] = TL_TOP_MESSAGE_MENTIONED,
[Ntf_EVENT_FOLLOWER ] = TL_TOP_MESSAGE_NONE, [Ntf_EVENT_FOLLOWER ] = TL_TOP_MESSAGE_NONE,
/* System tab */ /* System tab */
/* Country tab */ /* Country tab */
@ -1302,9 +1302,9 @@ static void TL_Not_RemoveNoteMediaAndDBEntries (struct TL_Not_Note *Not)
PubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod); PubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (PubCod > 0) if (PubCod > 0)
{ {
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV ,PubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod);
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE ,PubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE ,PubCod);
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_MENTION,PubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod);
} }
/***** Remove favs for this note *****/ /***** Remove favs for this note *****/

View File

@ -214,8 +214,8 @@ void TL_Ntf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
void TL_Ntf_MarkMyNotifAsSeen (void) void TL_Ntf_MarkMyNotifAsSeen (void)
{ {
Ntf_MarkNotifAsSeen (Ntf_EVENT_TIMELINE_COMMENT,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod); Ntf_MarkNotifAsSeen (Ntf_EVENT_TL_COMMENT,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
Ntf_MarkNotifAsSeen (Ntf_EVENT_TIMELINE_FAV ,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod); Ntf_MarkNotifAsSeen (Ntf_EVENT_TL_FAV ,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
Ntf_MarkNotifAsSeen (Ntf_EVENT_TIMELINE_SHARE ,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod); Ntf_MarkNotifAsSeen (Ntf_EVENT_TL_SHARE ,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
Ntf_MarkNotifAsSeen (Ntf_EVENT_TIMELINE_MENTION,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod); Ntf_MarkNotifAsSeen (Ntf_EVENT_TL_MENTION,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
} }

View File

@ -60,7 +60,7 @@ static void TL_Sha_ShaNote (struct TL_Not_Note *Not);
static void TL_Sha_UnsNote (struct TL_Not_Note *Not); static void TL_Sha_UnsNote (struct TL_Not_Note *Not);
/*****************************************************************************/ /*****************************************************************************/
/******************************** Share a note *******************************/ /****************************** Show all sharers *****************************/
/*****************************************************************************/ /*****************************************************************************/
void TL_Sha_ShowAllSharersNoteUsr (void) void TL_Sha_ShowAllSharersNoteUsr (void)
@ -86,6 +86,10 @@ void TL_Sha_ShowAllSharersNoteGbl (void)
TL_Usr_SHOW_ALL_USRS); TL_Usr_SHOW_ALL_USRS);
} }
/*****************************************************************************/
/******************************** Share a note *******************************/
/*****************************************************************************/
void TL_Sha_ShaNoteUsr (void) void TL_Sha_ShaNoteUsr (void)
{ {
/***** Get user whom profile is displayed *****/ /***** Get user whom profile is displayed *****/
@ -139,8 +143,7 @@ static void TL_Sha_ShaNote (struct TL_Not_Note *Not)
for the author of the post *****/ for the author of the post *****/
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod); OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0) if (OriginalPubCod > 0)
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod, TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_SHARE);
Ntf_EVENT_TIMELINE_SHARE);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -190,5 +193,5 @@ static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
/***** Mark possible notifications on this note as removed *****/ /***** Mark possible notifications on this note as removed *****/
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod); OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
if (OriginalPubCod > 0) if (OriginalPubCod > 0)
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE,OriginalPubCod); Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE,OriginalPubCod);
} }

View File

@ -61,6 +61,19 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
static void TL_Usr_GetAndShowSharersOrFavers (TL_Usr_FavSha_t FavSha,
long Cod,long UsrCod,unsigned NumUsrs,
TL_Usr_HowManyUsrs_t HowManyUsrs);
static void TL_Usr_ShowNumSharersOrFavers (unsigned NumUsrs);
static void TL_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res,
unsigned NumUsrs,unsigned NumFirstUsrs);
static unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha,
long Cod,long UsrCod,unsigned MaxUsrs,
MYSQL_RES **mysql_res);
static void TL_Usr_PutDisabledIconFavSha (TL_Usr_FavSha_t FavSha,
unsigned NumUsrs);
/*****************************************************************************/ /*****************************************************************************/
/************* Remove all the content of a user from database ****************/ /************* Remove all the content of a user from database ****************/
/*****************************************************************************/ /*****************************************************************************/
@ -113,9 +126,9 @@ void TL_Usr_RemoveUsrContent (long UsrCod)
/************** Show users who have faved/shared a note/comment **************/ /************** Show users who have faved/shared a note/comment **************/
/*****************************************************************************/ /*****************************************************************************/
void TL_Usr_GetAndShowSharersOrFavers (TL_Usr_FavSha_t FavSha, static void TL_Usr_GetAndShowSharersOrFavers (TL_Usr_FavSha_t FavSha,
long Cod,long UsrCod,unsigned NumUsrs, long Cod,long UsrCod,unsigned NumUsrs,
TL_Usr_HowManyUsrs_t HowManyUsrs) TL_Usr_HowManyUsrs_t HowManyUsrs)
{ {
static const TL_Frm_Action_t Action[TL_Usr_NUM_FAV_SHA] = static const TL_Frm_Action_t Action[TL_Usr_NUM_FAV_SHA] =
{ {
@ -167,15 +180,15 @@ void TL_Usr_GetAndShowSharersOrFavers (TL_Usr_FavSha_t FavSha,
/************************ Show sharers or favouriters ************************/ /************************ Show sharers or favouriters ************************/
/*****************************************************************************/ /*****************************************************************************/
void TL_Usr_ShowNumSharersOrFavers (unsigned NumUsrs) static void TL_Usr_ShowNumSharersOrFavers (unsigned NumUsrs)
{ {
/***** Show number of sharers or favers /***** Show number of sharers or favers
(users who have shared or marked this note as favourite) *****/ (users who have shared or marked this note as favourite) *****/
HTM_TxtF ("&nbsp;%u",NumUsrs); HTM_TxtF ("&nbsp;%u",NumUsrs);
} }
void TL_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res, static void TL_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res,
unsigned NumUsrs,unsigned NumFirstUsrs) unsigned NumUsrs,unsigned NumFirstUsrs)
{ {
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumUsr; unsigned NumUsr;
@ -269,9 +282,9 @@ bool TL_Usr_CheckIfFavedSharedByUsr (TL_Usr_FavSha_t FavSha,long Cod,long UsrCod
/******* Get list of users who have marked a note/comment as favourite *******/ /******* Get list of users who have marked a note/comment as favourite *******/
/*****************************************************************************/ /*****************************************************************************/
unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha, static unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha,
long Cod,long UsrCod,unsigned MaxUsrs, long Cod,long UsrCod,unsigned MaxUsrs,
MYSQL_RES **mysql_res) MYSQL_RES **mysql_res)
{ {
switch (FavSha) switch (FavSha)
{ {
@ -316,7 +329,8 @@ void TL_Usr_PutIconFavSha (TL_Usr_FavSha_t FavSha,
/****************** Put disabled icon to mark as favourite *******************/ /****************** Put disabled icon to mark as favourite *******************/
/*****************************************************************************/ /*****************************************************************************/
void TL_Usr_PutDisabledIconFavSha (TL_Usr_FavSha_t FavSha,unsigned NumUsrs) static void TL_Usr_PutDisabledIconFavSha (TL_Usr_FavSha_t FavSha,
unsigned NumUsrs)
{ {
extern const char *Txt_TIMELINE_Favourited_by_X_USERS; extern const char *Txt_TIMELINE_Favourited_by_X_USERS;
extern const char *Txt_TIMELINE_Not_favourited_by_anyone; extern const char *Txt_TIMELINE_Not_favourited_by_anyone;

View File

@ -69,21 +69,11 @@ typedef enum
void TL_Usr_RemoveUsrContent (long UsrCod); void TL_Usr_RemoveUsrContent (long UsrCod);
void TL_Usr_GetAndShowSharersOrFavers (TL_Usr_FavSha_t FavSha,
long Cod,long UsrCod,unsigned NumUsrs,
TL_Usr_HowManyUsrs_t HowManyUsrs);
void TL_Usr_ShowNumSharersOrFavers (unsigned NumUsrs);
void TL_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res,
unsigned NumUsrs,unsigned NumFirstUsrs);
bool TL_Usr_CheckICanFavSha (long Cod,long UsrCod); bool TL_Usr_CheckICanFavSha (long Cod,long UsrCod);
bool TL_Usr_CheckIfFavedSharedByUsr (TL_Usr_FavSha_t FavSha,long Cod,long UsrCod); bool TL_Usr_CheckIfFavedSharedByUsr (TL_Usr_FavSha_t FavSha,long Cod,long UsrCod);
unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha,
long Cod,long UsrCod,unsigned MaxUsrs,
MYSQL_RES **mysql_res);
void TL_Usr_PutIconFavSha (TL_Usr_FavSha_t FavSha, void TL_Usr_PutIconFavSha (TL_Usr_FavSha_t FavSha,
long Cod,long UsrCod,unsigned NumUsrs, long Cod,long UsrCod,unsigned NumUsrs,
TL_Usr_HowManyUsrs_t HowManyUsrs); TL_Usr_HowManyUsrs_t HowManyUsrs);
void TL_Usr_PutDisabledIconFavSha (TL_Usr_FavSha_t FavSha,unsigned NumUsrs);
#endif #endif