diff --git a/swad_changelog.h b/swad_changelog.h index 3c8e18c13..9e06e72a0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -121,13 +121,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.123.4 (2016-01-22)" +#define Log_PLATFORM_VERSION "SWAD 15.123.5 (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.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) Version 15.123.3: Jan 22, 2016 New social notifications. Not finished. (194280 lines) Version 15.123.2: Jan 22, 2016 New social notifications. Not finished. (194279 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 50c29525f..d9624a182 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -10627,10 +10627,10 @@ static void Brw_RemoveOneFileOrFolderFromDB (const char *Path) Brw_FileBrowser_t FileBrowser = Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type]; /***** Set possible notifications as removed. - Set possible social note as removed. + Set possible social note as unavailable. Important: do this before removing from files *****/ Ntf_MarkNotifOneFileAsRemoved (Path); - Soc_MarkSocialNoteOneFileAsRemoved (Path); + Soc_MarkSocialNoteOneFileAsUnavailable (Path); /***** Remove from database the entries that store the marks properties *****/ if (FileBrowser == Brw_ADMI_MARKS_CRS || diff --git a/swad_message.c b/swad_message.c index eafa7a962..506e6acfc 100644 --- a/swad_message.c +++ b/swad_message.c @@ -2843,22 +2843,23 @@ static void Msg_ShowASentOrReceivedMessage (Msg_TypeOfMessages_t TypeOfMessages, } /*****************************************************************************/ -/*********************** Show brief subject of a message *********************/ +/******************** Get subject and content of a message *******************/ /*****************************************************************************/ // This function may be called inside a web service, so don't report error -void Msg_GetNotifMessage (char *SummaryStr,char **ContentStr,long MsgCod,unsigned MaxChars,bool GetContent) +void Msg_GetNotifMessage (char *SummaryStr,char **ContentStr,long MsgCod, + unsigned MaxChars,bool GetContent) { extern const char *Txt_MSG_Subject; - char Query[512]; + char Query[128]; MYSQL_RES *mysql_res; MYSQL_ROW row; SummaryStr[0] = '\0'; // Return nothing on error /***** Get subject of message from database *****/ - sprintf (Query,"SELECT Subject,Content FROM msg_content" - " WHERE MsgCod='%ld'",MsgCod); + sprintf (Query,"SELECT Subject,Content FROM msg_content WHERE MsgCod='%ld'", + MsgCod); if (!mysql_query (&Gbl.mysql,Query)) if ((mysql_res = mysql_store_result (&Gbl.mysql)) != NULL) { diff --git a/swad_message.h b/swad_message.h index 54dcc8dc0..9c7cec2c1 100644 --- a/swad_message.h +++ b/swad_message.h @@ -95,7 +95,8 @@ void Msg_GetDistinctCoursesInMyMessages (Msg_TypeOfMessages_t TypeOfMessages); void Msg_ShowFormSelectCourseSentOrRecMsgs (Msg_TypeOfMessages_t TypeOfMessages); void Msg_ShowFormToFilterMsgs (Msg_TypeOfMessages_t TypeOfMessages); void Msg_GetMsgSubject (long MsgCod,char *Subject); -void Msg_GetNotifMessage (char *SummaryStr,char **ContentStr,long MsgCod,unsigned MaxChars,bool GetContent); +void Msg_GetNotifMessage (char *SummaryStr,char **ContentStr,long MsgCod, + unsigned MaxChars,bool GetContent); void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg); void Msg_WriteMsgAuthor (struct UsrData *UsrDat, diff --git a/swad_notification.c b/swad_notification.c index 60b77bf52..a373f3ace 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -585,7 +585,8 @@ void Ntf_ShowMyNotifications (void) { ContentStr = NULL; Ntf_GetNotifSummaryAndContent (SummaryStr,&ContentStr,NotifyEvent, - Cod,Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod,Cfg_MAX_CHARS_NOTIF_SUMMARY_SWAD,false); + Cod,Crs.CrsCod,Gbl.Usrs.Me.UsrDat.UsrCod, + Cfg_MAX_CHARS_NOTIF_SUMMARY_SWAD,false); fprintf (Gbl.F.Out,"" "" "notificationsArray.__ptr[NumRow].summary = (char *) soap_malloc (Gbl.soap,strlen (SummaryStr)+1); strcpy (getNotificationsOut->notificationsArray.__ptr[NumRow].summary,SummaryStr);