From 2c93cbce9a8cb15335e7a30823bcb216908b2eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 25 Jan 2016 12:00:10 +0100 Subject: [PATCH] Version 15.127.2 --- swad_changelog.h | 4 ++-- swad_social.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index c6342db5f..638cdab0e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -121,19 +121,19 @@ // TODO: When receiving a new post, create first the publishing, then the post // TODO: Change PstCod to PubCod in social_posts, removing AUTO_INCREMENT // TODO: View highlighted social note when clicking in timeline notification -// TODO: Mark timeline notifications as removed when unfav? /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.127.1 (2016-01-25)" +#define Log_PLATFORM_VERSION "SWAD 15.127.2 (2016-01-25)" #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.127.2: Jan 25, 2016 Mark timeline notifications as removed when a social note/comment is unfaved. (194838 lines) Version 15.127.1: Jan 25, 2016 Mark timeline notifications as removed when a social note is unshared. (194831 lines) Version 15.127: Jan 25, 2016 New function to count the number of @nicknames in a text and store it in social publishing. (194825 lines) Version 15.126.1: Jan 24, 2016 Optimization in code to insert links. (194736 lines) diff --git a/swad_social.c b/swad_social.c index 1530cdff7..646f0b8a6 100644 --- a/swad_social.c +++ b/swad_social.c @@ -3157,6 +3157,7 @@ static long Soc_UnfavSocialNote (void) extern const char *Txt_The_original_post_no_longer_exists; struct SocialNote SocNot; char Query[256]; + long PubCod; /***** Get data of social note *****/ SocNot.NotCod = Soc_GetParamNotCod (); @@ -3180,6 +3181,11 @@ static long Soc_UnfavSocialNote (void) /***** Update number of times this social note is favourited *****/ SocNot.NumFavs = Soc_GetNumTimesANoteHasBeenFav (&SocNot); + /***** Mark possible notifications on this social note as removed *****/ + PubCod = Soc_GetPubCodOfOriginalSocialNote (SocNot.NotCod); + if (PubCod > 0) + Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,PubCod); + /***** Show the social note just unfavourited *****/ Soc_WriteSocialNote (&SocNot, Soc_TOP_MESSAGE_UNFAV,Gbl.Usrs.Me.UsrDat.UsrCod, @@ -3258,6 +3264,9 @@ static long Soc_UnfavSocialComment (void) /***** Update number of times this social comment is favourited *****/ SocCom.NumFavs = Soc_GetNumTimesACommHasBeenFav (&SocCom); + /***** Mark possible notifications on this social comment as removed *****/ + Ntf_MarkNotifAsRemoved (Ntf_EVENT_TIMELINE_FAV,SocCom.ComCod); + /***** Show the social comment just unfavourited *****/ Soc_WriteSocialComment (&SocCom, Soc_TOP_MESSAGE_UNFAV,Gbl.Usrs.Me.UsrDat.UsrCod,