From a3379035aaeee2af3c05061e6b990dd71464cf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Fri, 22 Jan 2016 12:55:28 +0100 Subject: [PATCH] Version 15.123.7 --- swad_changelog.h | 3 ++- swad_notification.c | 10 ++++++---- swad_notification.h | 14 +++++++------- swad_social.c | 5 ++++- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index eda4490d1..9e77cb68c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -121,13 +121,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.123.6 (2016-01-22)" +#define Log_PLATFORM_VERSION "SWAD 15.123.7 (2016-01-22)" #define CSS_FILE "swad15.121.7.css" #define JS_FILE "swad15.121.7.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 15.123.7: Jan 22, 2016 New social notifications. Not finished. (194347 lines) Version 15.123.6: Jan 22, 2016 New social notifications. Not finished. (194342 lines) Version 15.123.5: Jan 22, 2016 New social notifications. Not finished. (194328 lines) Version 15.123.4: Jan 22, 2016 New social notifications. Not finished. (194281 lines) diff --git a/swad_notification.c b/swad_notification.c index d2ca734e6..bc49e3381 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -844,6 +844,7 @@ void Ntf_GetNotifSummaryAndContent (char *SummaryStr,char **ContentStr, Soc_GetNotifNewSocialPost (SummaryStr,ContentStr,Cod,MaxChars,GetContent); break; case Ntf_EVENT_SOCIAL_COMMENT: + Soc_GetNotifNewSocialComment (SummaryStr,ContentStr,Cod,MaxChars,GetContent); break; case Ntf_EVENT_SOCIAL_FAV: break; @@ -1197,17 +1198,18 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod) Gbl.CurrentDeg.Deg.DegCod, Gbl.Usrs.Me.UsrDat.UsrCod); break; - case Ntf_EVENT_SOCIAL_POST: + case Ntf_EVENT_SOCIAL_POST: // New social post from one of the users I follow // Get all my followers sprintf (Query,"SELECT FollowerCod FROM usr_follow" " WHERE FollowedCod='%ld'", Gbl.Usrs.Me.UsrDat.UsrCod); break; - case Ntf_EVENT_SOCIAL_COMMENT: + case Ntf_EVENT_SOCIAL_COMMENT: // New comment to one of my social notes + !!! break; - case Ntf_EVENT_SOCIAL_FAV: + case Ntf_EVENT_SOCIAL_FAV: // New favourite to one of my social notes or comments break; - case Ntf_EVENT_SOCIAL_SHARE: + case Ntf_EVENT_SOCIAL_SHARE: // New sharing of one of my social notes break; case Ntf_EVENT_FOLLOWER: // This function should not be called in this case return 0; diff --git a/swad_notification.h b/swad_notification.h index 75c9d7dcb..1bbc68ee7 100644 --- a/swad_notification.h +++ b/swad_notification.h @@ -59,13 +59,13 @@ typedef enum Ntf_EVENT_ENROLLMENT_REQUEST = 8, /* Social tab */ - Ntf_EVENT_SOCIAL_POST = 9, - Ntf_EVENT_SOCIAL_COMMENT = 10, - Ntf_EVENT_SOCIAL_FAV = 11, - Ntf_EVENT_SOCIAL_SHARE = 12, - Ntf_EVENT_FOLLOWER = 13, // Old 14 - Ntf_EVENT_FORUM_POST_COURSE = 14, // Old 10 - Ntf_EVENT_FORUM_REPLY = 15, // Old 11 + Ntf_EVENT_SOCIAL_POST = 9, // New social post from one of the users I follow + Ntf_EVENT_SOCIAL_COMMENT = 10, // New comment to one of my social notes + Ntf_EVENT_SOCIAL_FAV = 11, // New favourite to one of my social notes or comments + Ntf_EVENT_SOCIAL_SHARE = 12, // New sharing of one of my social notes + Ntf_EVENT_FOLLOWER = 13, // Old 14 + Ntf_EVENT_FORUM_POST_COURSE = 14, // Old 10 // New post in forums of my courses + Ntf_EVENT_FORUM_REPLY = 15, // Old 11 // New reply to one of my posts in any forum /* Messages tab */ Ntf_EVENT_NOTICE = 16, // Old 9 diff --git a/swad_social.c b/swad_social.c index 3a2840532..9cc21bcee 100644 --- a/swad_social.c +++ b/swad_social.c @@ -1992,7 +1992,7 @@ static long Soc_ReceiveSocialPost (void) /* Insert post in social notes */ NotCod = Soc_StoreAndPublishSocialNote (Soc_NOTE_SOCIAL_POST,PstCod); - /***** Notify by e-mail about the new notice *****/ + /***** Store notification about the new post *****/ Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_SOCIAL_POST,NotCod); } else @@ -2706,6 +2706,9 @@ static long Soc_ReceiveComment (void) Content); DB_QueryINSERT (Query,"can not store comment content"); + /***** Store notification about the new comment *****/ + Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_SOCIAL_COMMENT,SocNot.NotCod); + /***** Show the social note just commented *****/ Soc_WriteSocialNote (&SocNot, Soc_TOP_MESSAGE_COMMENTED,Gbl.Usrs.Me.UsrDat.UsrCod,