mirror of https://github.com/acanas/swad-core.git
Version 20.40.3: Mar 03, 2021 Code refactoring in timeline.
This commit is contained in:
parent
dca0e83339
commit
dd6a4a7357
|
@ -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.40.2 (2021-03-03)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.40.3 (2021-03-03)"
|
||||
#define CSS_FILE "swad20.33.9.css"
|
||||
#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.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)
|
||||
|
|
|
@ -71,10 +71,10 @@ const char *Ntf_WSNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
{
|
||||
[Ntf_EVENT_UNKNOWN ] = "unknown",
|
||||
/* Start tab */
|
||||
[Ntf_EVENT_TIMELINE_COMMENT ] = "timelineComment",
|
||||
[Ntf_EVENT_TIMELINE_FAV ] = "timelineFav",
|
||||
[Ntf_EVENT_TIMELINE_SHARE ] = "timelineShare",
|
||||
[Ntf_EVENT_TIMELINE_MENTION ] = "timelineMention",
|
||||
[Ntf_EVENT_TL_COMMENT ] = "timelineComment",
|
||||
[Ntf_EVENT_TL_FAV ] = "timelineFav",
|
||||
[Ntf_EVENT_TL_SHARE ] = "timelineShare",
|
||||
[Ntf_EVENT_TL_MENTION ] = "timelineMention",
|
||||
[Ntf_EVENT_FOLLOWER ] = "follower",
|
||||
/* System tab */
|
||||
/* Country tab */
|
||||
|
@ -109,10 +109,10 @@ static const Act_Action_t Ntf_DefaultActions[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
{
|
||||
[Ntf_EVENT_UNKNOWN ] = ActUnk,
|
||||
/* Start tab */
|
||||
[Ntf_EVENT_TIMELINE_COMMENT ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_TIMELINE_FAV ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_TIMELINE_SHARE ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_TIMELINE_MENTION ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_TL_COMMENT ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_TL_FAV ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_TL_SHARE ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_TL_MENTION ] = ActSeeGblTL,
|
||||
[Ntf_EVENT_FOLLOWER ] = ActSeeFlr,
|
||||
/* System tab */
|
||||
/* Country tab */
|
||||
|
@ -152,10 +152,10 @@ static const char *Ntf_ParamNotifMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
{
|
||||
[Ntf_EVENT_UNKNOWN ] = "NotifyNtfEventUnknown",
|
||||
/* Start tab */
|
||||
[Ntf_EVENT_TIMELINE_COMMENT ] = "NotifyNtfEventTimelineComment",
|
||||
[Ntf_EVENT_TIMELINE_FAV ] = "NotifyNtfEventTimelineFav",
|
||||
[Ntf_EVENT_TIMELINE_SHARE ] = "NotifyNtfEventTimelineShare",
|
||||
[Ntf_EVENT_TIMELINE_MENTION ] = "NotifyNtfEventTimelineMention",
|
||||
[Ntf_EVENT_TL_COMMENT ] = "NotifyNtfEventTimelineComment",
|
||||
[Ntf_EVENT_TL_FAV ] = "NotifyNtfEventTimelineFav",
|
||||
[Ntf_EVENT_TL_SHARE ] = "NotifyNtfEventTimelineShare",
|
||||
[Ntf_EVENT_TL_MENTION ] = "NotifyNtfEventTimelineMention",
|
||||
[Ntf_EVENT_FOLLOWER ] = "NotifyNtfEventFollower",
|
||||
/* System tab */
|
||||
/* Country tab */
|
||||
|
@ -191,10 +191,10 @@ static const char *Ntf_ParamEmailMeAboutNotifyEvents[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
{
|
||||
[Ntf_EVENT_UNKNOWN ] = "EmailNtfEventUnknown",
|
||||
/* Start tab */
|
||||
[Ntf_EVENT_TIMELINE_COMMENT ] = "EmailNtfEventTimelineComment",
|
||||
[Ntf_EVENT_TIMELINE_FAV ] = "EmailNtfEventTimelineFav",
|
||||
[Ntf_EVENT_TIMELINE_SHARE ] = "EmailNtfEventTimelineShare",
|
||||
[Ntf_EVENT_TIMELINE_MENTION ] = "EmailNtfEventTimelineMention",
|
||||
[Ntf_EVENT_TL_COMMENT ] = "EmailNtfEventTimelineComment",
|
||||
[Ntf_EVENT_TL_FAV ] = "EmailNtfEventTimelineFav",
|
||||
[Ntf_EVENT_TL_SHARE ] = "EmailNtfEventTimelineShare",
|
||||
[Ntf_EVENT_TL_MENTION ] = "EmailNtfEventTimelineMention",
|
||||
[Ntf_EVENT_FOLLOWER ] = "EmailNtfEventSocialFollower",
|
||||
/* System tab */
|
||||
/* Country tab */
|
||||
|
@ -230,10 +230,10 @@ static const char *Ntf_Icons[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
{
|
||||
[Ntf_EVENT_UNKNOWN ] = "question.svg",
|
||||
/* Start tab */
|
||||
[Ntf_EVENT_TIMELINE_COMMENT ] = "comment-dots.svg",
|
||||
[Ntf_EVENT_TIMELINE_FAV ] = "star.svg",
|
||||
[Ntf_EVENT_TIMELINE_SHARE ] = "share-alt.svg",
|
||||
[Ntf_EVENT_TIMELINE_MENTION ] = "at.svg",
|
||||
[Ntf_EVENT_TL_COMMENT ] = "comment-dots.svg",
|
||||
[Ntf_EVENT_TL_FAV ] = "star.svg",
|
||||
[Ntf_EVENT_TL_SHARE ] = "share-alt.svg",
|
||||
[Ntf_EVENT_TL_MENTION ] = "at.svg",
|
||||
[Ntf_EVENT_FOLLOWER ] = "user-plus.svg",
|
||||
/* System tab */
|
||||
/* Country tab */
|
||||
|
@ -719,10 +719,10 @@ static bool Ntf_StartFormGoToAction (Ntf_NotifyEvent_t NotifyEvent,
|
|||
Brw_PutHiddenParamFilCod (FileMetadata.FilCod);
|
||||
}
|
||||
break;
|
||||
case Ntf_EVENT_TIMELINE_COMMENT:
|
||||
case Ntf_EVENT_TIMELINE_FAV:
|
||||
case Ntf_EVENT_TIMELINE_SHARE:
|
||||
case Ntf_EVENT_TIMELINE_MENTION:
|
||||
case Ntf_EVENT_TL_COMMENT:
|
||||
case Ntf_EVENT_TL_FAV:
|
||||
case Ntf_EVENT_TL_SHARE:
|
||||
case Ntf_EVENT_TL_MENTION:
|
||||
// Cod is the code of the social publishing
|
||||
Frm_BeginForm (ActSeeGblTL);
|
||||
TL_Pub_PutHiddenParamPubCod (Cod);
|
||||
|
@ -872,10 +872,10 @@ void Ntf_GetNotifSummaryAndContent (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
|||
case Ntf_EVENT_ENROLMENT_REQUEST:
|
||||
Enr_GetNotifEnrolmentRequest (SummaryStr,ContentStr,Cod,GetContent);
|
||||
break;
|
||||
case Ntf_EVENT_TIMELINE_COMMENT:
|
||||
case Ntf_EVENT_TIMELINE_FAV:
|
||||
case Ntf_EVENT_TIMELINE_SHARE:
|
||||
case Ntf_EVENT_TIMELINE_MENTION:
|
||||
case Ntf_EVENT_TL_COMMENT:
|
||||
case Ntf_EVENT_TL_FAV:
|
||||
case Ntf_EVENT_TL_SHARE:
|
||||
case Ntf_EVENT_TL_MENTION:
|
||||
// Cod is the code of the social publishing
|
||||
TL_Ntf_GetNotifPublication (SummaryStr,ContentStr,Cod,GetContent);
|
||||
break;
|
||||
|
@ -1291,7 +1291,7 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
|
|||
Sco_GetDBStrFromScope (Hie_Lvl_DEG),Gbl.Hierarchy.Deg.DegCod,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
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
|
||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get users"
|
||||
" to be notified",
|
||||
|
@ -1302,9 +1302,9 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod)
|
|||
" AND PublisherCod<>%ld",
|
||||
Cod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
break;
|
||||
case Ntf_EVENT_TIMELINE_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_TIMELINE_MENTION:
|
||||
case Ntf_EVENT_TL_FAV: // New favourite to one of my social notes or comments
|
||||
case Ntf_EVENT_TL_SHARE: // New sharing of one of my social notes
|
||||
case Ntf_EVENT_TL_MENTION:
|
||||
case Ntf_EVENT_FOLLOWER:
|
||||
// This function should not be called in these cases
|
||||
return 0;
|
||||
|
@ -1692,10 +1692,10 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
|
|||
switch (NotifyEvent)
|
||||
{
|
||||
case Ntf_EVENT_UNKNOWN:
|
||||
case Ntf_EVENT_TIMELINE_COMMENT:
|
||||
case Ntf_EVENT_TIMELINE_FAV:
|
||||
case Ntf_EVENT_TIMELINE_SHARE:
|
||||
case Ntf_EVENT_TIMELINE_MENTION:
|
||||
case Ntf_EVENT_TL_COMMENT:
|
||||
case Ntf_EVENT_TL_FAV:
|
||||
case Ntf_EVENT_TL_SHARE:
|
||||
case Ntf_EVENT_TL_MENTION:
|
||||
case Ntf_EVENT_FOLLOWER:
|
||||
break;
|
||||
case Ntf_EVENT_DOCUMENT_FILE:
|
||||
|
|
|
@ -55,10 +55,10 @@ typedef enum // TODO: Change numbers (also in database)!!!!!!!!!!!!!!
|
|||
{
|
||||
Ntf_EVENT_UNKNOWN = 0,
|
||||
/* Start tab */
|
||||
Ntf_EVENT_TIMELINE_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_TIMELINE_SHARE = 12, // New sharing of one of my social notes
|
||||
Ntf_EVENT_TIMELINE_MENTION = 13, // New mention
|
||||
Ntf_EVENT_TL_COMMENT = 10, // New comment to 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_TL_SHARE = 12, // New sharing of one of my social notes
|
||||
Ntf_EVENT_TL_MENTION = 13, // New mention
|
||||
Ntf_EVENT_FOLLOWER = 14,
|
||||
/* System tab */
|
||||
/* Country tab */
|
||||
|
|
|
@ -749,11 +749,11 @@ void Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (long PubCod,const char *T
|
|||
Usr_GetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS);
|
||||
|
||||
/* 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)
|
||||
{
|
||||
NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TIMELINE_MENTION));
|
||||
Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_TIMELINE_MENTION,&UsrDat,PubCod,
|
||||
NotifyByEmail = (UsrDat.NtfEvents.SendEmail & (1 << Ntf_EVENT_TL_MENTION));
|
||||
Ntf_StoreNotifyEventToOneUser (Ntf_EVENT_TL_MENTION,&UsrDat,PubCod,
|
||||
(Ntf_Status_t) (NotifyByEmail ? Ntf_STATUS_BIT_EMAIL :
|
||||
0),
|
||||
Gbl.Hierarchy.Ins.InsCod,
|
||||
|
|
16
swad_text.c
16
swad_text.c
|
@ -27898,7 +27898,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Novos pedidos de inscrição"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_COMMENT] =
|
||||
[Ntf_EVENT_TL_COMMENT] =
|
||||
#if L==1 // ca
|
||||
"Nous comentaris als meus missatges socials"
|
||||
#elif L==2 // de
|
||||
|
@ -27919,7 +27919,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Novos comentário às minhos posts sociais"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_FAV] =
|
||||
[Ntf_EVENT_TL_FAV] =
|
||||
#if L==1 // ca
|
||||
"Nous favorits als meus missatges socials"
|
||||
#elif L==2 // de
|
||||
|
@ -27940,7 +27940,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Novos favoritos às minhos posts sociais"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_SHARE] =
|
||||
[Ntf_EVENT_TL_SHARE] =
|
||||
#if L==1 // ca
|
||||
"Noves comparticions dels meus missatges socials"
|
||||
#elif L==2 // de
|
||||
|
@ -27961,7 +27961,7 @@ const char *Txt_NOTIFY_EVENTS_PLURAL[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Novas partilhas de minhos posts sociais"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_MENTION] =
|
||||
[Ntf_EVENT_TL_MENTION] =
|
||||
#if L==1 // ca
|
||||
"Noves mencions"
|
||||
#elif L==2 // de
|
||||
|
@ -28342,7 +28342,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Pedido de inscrição"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_COMMENT] =
|
||||
[Ntf_EVENT_TL_COMMENT] =
|
||||
#if L==1 // ca
|
||||
"Comentari a un missatge social"
|
||||
#elif L==2 // de
|
||||
|
@ -28363,7 +28363,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Comentário a um post sociais"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_FAV] =
|
||||
[Ntf_EVENT_TL_FAV] =
|
||||
#if L==1 // ca
|
||||
"Missatge social marcat com favorit"
|
||||
#elif L==2 // de
|
||||
|
@ -28384,7 +28384,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Post sociais marcado como favorito"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_SHARE] =
|
||||
[Ntf_EVENT_TL_SHARE] =
|
||||
#if L==1 // ca
|
||||
"Missatge social compartit"
|
||||
#elif L==2 // de
|
||||
|
@ -28405,7 +28405,7 @@ const char *Txt_NOTIFY_EVENTS_SINGULAR[Ntf_NUM_NOTIFY_EVENTS] =
|
|||
"Post sociais compartido"
|
||||
#endif
|
||||
,
|
||||
[Ntf_EVENT_TIMELINE_MENTION] =
|
||||
[Ntf_EVENT_TL_MENTION] =
|
||||
#if L==1 // ca
|
||||
"Menció"
|
||||
#elif L==2 // de
|
||||
|
|
|
@ -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_PT ] = "Novo pedido de inscrição",
|
||||
},
|
||||
[Ntf_EVENT_TIMELINE_COMMENT] =
|
||||
[Ntf_EVENT_TL_COMMENT] =
|
||||
{
|
||||
[Lan_LANGUAGE_UNKNOWN] = "",
|
||||
[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_PT ] = "Novo comentário a um post sociais",
|
||||
},
|
||||
[Ntf_EVENT_TIMELINE_FAV] =
|
||||
[Ntf_EVENT_TL_FAV] =
|
||||
{
|
||||
[Lan_LANGUAGE_UNKNOWN] = "",
|
||||
[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_PT ] = "Novo favorito a um post sociais",
|
||||
},
|
||||
[Ntf_EVENT_TIMELINE_SHARE] =
|
||||
[Ntf_EVENT_TL_SHARE] =
|
||||
{
|
||||
[Lan_LANGUAGE_UNKNOWN] = "",
|
||||
[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_PT ] = "Nova partilha de post sociais",
|
||||
},
|
||||
[Ntf_EVENT_TIMELINE_MENTION] =
|
||||
[Ntf_EVENT_TL_MENTION] =
|
||||
{
|
||||
[Lan_LANGUAGE_UNKNOWN] = "",
|
||||
[Lan_LANGUAGE_CA ] = "Nova menció",
|
||||
|
|
|
@ -775,7 +775,7 @@ static long TL_Com_ReceiveComm (void)
|
|||
TL_DB_InsertCommContent (Pub.PubCod,&Content);
|
||||
|
||||
/***** 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 *****/
|
||||
Str_AnalyzeTxtAndStoreNotifyEventToMentionedUsrs (Pub.PubCod,Content.Txt);
|
||||
|
@ -1003,9 +1003,9 @@ void TL_Com_RemoveCommMediaAndDBEntries (long PubCod)
|
|||
Med_RemoveMedia (TL_DB_GetMedCodFromComm (PubCod));
|
||||
|
||||
/***** Mark possible notifications on this comment as removed *****/
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_COMMENT,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV ,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_MENTION,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_COMMENT,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod);
|
||||
|
||||
/***** Remove favs for this comment *****/
|
||||
TL_DB_RemoveCommFavs (PubCod);
|
||||
|
|
|
@ -63,7 +63,7 @@ static void TL_Fav_FavComm (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)
|
||||
|
@ -89,6 +89,10 @@ void TL_Fav_ShowAllFaversNoteGbl (void)
|
|||
TL_Usr_SHOW_ALL_USRS);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Mark/unmark a note as favourite **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void TL_Fav_FavNoteUsr (void)
|
||||
{
|
||||
/***** 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 *****/
|
||||
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
|
||||
if (OriginalPubCod > 0)
|
||||
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,
|
||||
Ntf_EVENT_TIMELINE_FAV);
|
||||
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_FAV);
|
||||
}
|
||||
|
||||
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 *****/
|
||||
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
|
||||
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)
|
||||
|
@ -224,6 +227,10 @@ void TL_Fav_ShowAllFaversComGbl (void)
|
|||
TL_Usr_SHOW_ALL_USRS);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Mark/unmark a comment as favourite ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void TL_Fav_FavCommUsr (void)
|
||||
{
|
||||
/***** 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
|
||||
for the author of the post *****/
|
||||
TL_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,
|
||||
Ntf_EVENT_TIMELINE_FAV);
|
||||
TL_Ntf_CreateNotifToAuthor (Com->UsrCod,Com->PubCod,Ntf_EVENT_TL_FAV);
|
||||
|
||||
/***** Free image *****/
|
||||
Med_MediaDestructor (&Com->Content.Media);
|
||||
|
@ -340,7 +346,7 @@ static void TL_Fav_UnfComm (struct TL_Com_Comment *Com)
|
|||
Com->PubCod,Com->UsrCod);
|
||||
|
||||
/***** 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 *****/
|
||||
Med_MediaDestructor (&Com->Content.Media);
|
||||
|
|
|
@ -126,10 +126,10 @@ void TL_Not_ShowHighlightedNote (struct TL_Timeline *Timeline,
|
|||
{
|
||||
[Ntf_EVENT_UNKNOWN ] = TL_TOP_MESSAGE_NONE,
|
||||
/* Start tab */
|
||||
[Ntf_EVENT_TIMELINE_COMMENT ] = TL_TOP_MESSAGE_COMMENTED,
|
||||
[Ntf_EVENT_TIMELINE_FAV ] = TL_TOP_MESSAGE_FAVED,
|
||||
[Ntf_EVENT_TIMELINE_SHARE ] = TL_TOP_MESSAGE_SHARED,
|
||||
[Ntf_EVENT_TIMELINE_MENTION ] = TL_TOP_MESSAGE_MENTIONED,
|
||||
[Ntf_EVENT_TL_COMMENT ] = TL_TOP_MESSAGE_COMMENTED,
|
||||
[Ntf_EVENT_TL_FAV ] = TL_TOP_MESSAGE_FAVED,
|
||||
[Ntf_EVENT_TL_SHARE ] = TL_TOP_MESSAGE_SHARED,
|
||||
[Ntf_EVENT_TL_MENTION ] = TL_TOP_MESSAGE_MENTIONED,
|
||||
[Ntf_EVENT_FOLLOWER ] = TL_TOP_MESSAGE_NONE,
|
||||
/* System tab */
|
||||
/* Country tab */
|
||||
|
@ -1302,9 +1302,9 @@ static void TL_Not_RemoveNoteMediaAndDBEntries (struct TL_Not_Note *Not)
|
|||
PubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
|
||||
if (PubCod > 0)
|
||||
{
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV ,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE ,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_MENTION,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_FAV ,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE ,PubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_MENTION,PubCod);
|
||||
}
|
||||
|
||||
/***** Remove favs for this note *****/
|
||||
|
|
|
@ -214,8 +214,8 @@ void TL_Ntf_GetNotifPublication (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
|||
|
||||
void TL_Ntf_MarkMyNotifAsSeen (void)
|
||||
{
|
||||
Ntf_MarkNotifAsSeen (Ntf_EVENT_TIMELINE_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_TIMELINE_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_COMMENT,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
Ntf_MarkNotifAsSeen (Ntf_EVENT_TL_FAV ,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
Ntf_MarkNotifAsSeen (Ntf_EVENT_TL_SHARE ,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
Ntf_MarkNotifAsSeen (Ntf_EVENT_TL_MENTION,-1L,-1L,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ static void TL_Sha_ShaNote (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)
|
||||
|
@ -86,6 +86,10 @@ void TL_Sha_ShowAllSharersNoteGbl (void)
|
|||
TL_Usr_SHOW_ALL_USRS);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******************************** Share a note *******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void TL_Sha_ShaNoteUsr (void)
|
||||
{
|
||||
/***** 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 *****/
|
||||
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
|
||||
if (OriginalPubCod > 0)
|
||||
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,
|
||||
Ntf_EVENT_TIMELINE_SHARE);
|
||||
TL_Ntf_CreateNotifToAuthor (Not->UsrCod,OriginalPubCod,Ntf_EVENT_TL_SHARE);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -190,5 +193,5 @@ static void TL_Sha_UnsNote (struct TL_Not_Note *Not)
|
|||
/***** Mark possible notifications on this note as removed *****/
|
||||
OriginalPubCod = TL_DB_GetPubCodOfOriginalNote (Not->NotCod);
|
||||
if (OriginalPubCod > 0)
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_SHARE,OriginalPubCod);
|
||||
Ntf_MarkNotifAsRemoved (Ntf_EVENT_TL_SHARE,OriginalPubCod);
|
||||
}
|
||||
|
|
|
@ -61,6 +61,19 @@ extern struct Globals Gbl;
|
|||
/***************************** 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 ****************/
|
||||
/*****************************************************************************/
|
||||
|
@ -113,9 +126,9 @@ void TL_Usr_RemoveUsrContent (long UsrCod)
|
|||
/************** Show users who have faved/shared a note/comment **************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void TL_Usr_GetAndShowSharersOrFavers (TL_Usr_FavSha_t FavSha,
|
||||
long Cod,long UsrCod,unsigned NumUsrs,
|
||||
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
||||
static void TL_Usr_GetAndShowSharersOrFavers (TL_Usr_FavSha_t FavSha,
|
||||
long Cod,long UsrCod,unsigned NumUsrs,
|
||||
TL_Usr_HowManyUsrs_t HowManyUsrs)
|
||||
{
|
||||
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 ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void TL_Usr_ShowNumSharersOrFavers (unsigned NumUsrs)
|
||||
static void TL_Usr_ShowNumSharersOrFavers (unsigned NumUsrs)
|
||||
{
|
||||
/***** Show number of sharers or favers
|
||||
(users who have shared or marked this note as favourite) *****/
|
||||
HTM_TxtF (" %u",NumUsrs);
|
||||
}
|
||||
|
||||
void TL_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res,
|
||||
unsigned NumUsrs,unsigned NumFirstUsrs)
|
||||
static void TL_Usr_ListSharersOrFavers (MYSQL_RES **mysql_res,
|
||||
unsigned NumUsrs,unsigned NumFirstUsrs)
|
||||
{
|
||||
MYSQL_ROW row;
|
||||
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 *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha,
|
||||
long Cod,long UsrCod,unsigned MaxUsrs,
|
||||
MYSQL_RES **mysql_res)
|
||||
static unsigned TL_Usr_GetListFaversOrSharers (TL_Usr_FavSha_t FavSha,
|
||||
long Cod,long UsrCod,unsigned MaxUsrs,
|
||||
MYSQL_RES **mysql_res)
|
||||
{
|
||||
switch (FavSha)
|
||||
{
|
||||
|
@ -316,7 +329,8 @@ void TL_Usr_PutIconFavSha (TL_Usr_FavSha_t FavSha,
|
|||
/****************** 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_Not_favourited_by_anyone;
|
||||
|
|
|
@ -69,21 +69,11 @@ typedef enum
|
|||
|
||||
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_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,
|
||||
long Cod,long UsrCod,unsigned NumUsrs,
|
||||
TL_Usr_HowManyUsrs_t HowManyUsrs);
|
||||
void TL_Usr_PutDisabledIconFavSha (TL_Usr_FavSha_t FavSha,unsigned NumUsrs);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue