From 29e260ceea0521223a1c6457ccf5f25b9e462c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 12 Mar 2019 10:47:40 +0100 Subject: [PATCH] Version18.73.4 --- swad_action.c | 2 +- swad_changelog.h | 6 ++++-- swad_message.c | 3 +-- swad_message.h | 1 + swad_record.c | 10 +++++++--- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/swad_action.c b/swad_action.c index 55a31187f..16a8b8cdf 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2864,7 +2864,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqMsgUsr */{ 26, 4,TabMsg,ActReqMsgUsr ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Msg_FormMsgUsrs ,"marker" }, /* ActSeeRcvMsg */{ 3, 5,TabMsg,ActSeeRcvMsg ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Msg_ShowRecMsgs ,"inbox" }, /* ActSeeSntMsg */{ 70, 6,TabMsg,ActSeeSntMsg ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Msg_ShowSntMsgs ,"share" }, - /* ActMaiStd */{ 100, 7,TabMsg,ActMaiStd ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mai_ListEmails ,"envelope" }, + /* ActMaiStd */{ 100, 7,TabMsg,ActMaiStd ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Mai_ListEmails ,"envelope" }, // Actions not in menu: /* ActWriAnn */{1237,-1,TabUnk,ActSeeAnn ,0x200,0x200,0x200,0x200,0x200,0x200,0x200,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Ann_ShowFormAnnouncement ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index 71d95fa33..0b49c0755 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -432,7 +432,7 @@ Lo de mutear anuncios, en principio prefiero hacer una opci // TODO: Intentar aumentar la velocidad de carga del timeline (comprobar ralentización al mostrar la titulación de cada usuario) -// TODO: Fix bug: Don't show icon in record to send a message is user has banned me +// TODO: Poner opción en lista de estudiantes para enviar correo electrónico /*****************************************************************************/ /****************************** Public constants *****************************/ @@ -453,10 +453,12 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.73.2 (2019-03-12)" +#define Log_PLATFORM_VERSION "SWAD 18.73.4 (2019-03-12)" #define CSS_FILE "swad18.68.3.css" #define JS_FILE "swad18.64.js" /* + Version 18.73.4: Mar 12, 2019 Non-editing teachers can send email to students. (239555 lines) + Version 18.73.3: Mar 12, 2019 Don't show icon in record to send a message is user has banned me. (239553 lines) Version 18.73.2: Mar 12, 2019 Only user's groups are selectable when sending a message. (239549 lines) Version 18.73.1: Mar 12, 2019 Code refactoring in list of options when listing several users. (239569 lines) Version 18.73: Mar 12, 2019 New actions to follow/unfollow several users. Suggested by José María Guirao Miras. (239658 lines) diff --git a/swad_message.c b/swad_message.c index 11dfdbab7..3c67eca69 100644 --- a/swad_message.c +++ b/swad_message.c @@ -151,7 +151,6 @@ static void Msg_WriteMsgTo (long MsgCod); static void Msg_PutFormToBanSender (struct UsrData *UsrDat); static void Msg_PutFormToUnbanSender (struct UsrData *UsrDat); static void Msg_UnbanSender (void); -static bool Msg_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod); /*****************************************************************************/ /***************** Put a form to write a new message to users ****************/ @@ -3763,7 +3762,7 @@ static void Msg_UnbanSender (void) /**************** Chech if a user is banned by another user ******************/ /*****************************************************************************/ -static bool Msg_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod) +bool Msg_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod) { /***** Get if FromUsrCod is banned by ToUsrCod *****/ return (DB_QueryCOUNT ("can not check if a user is banned", diff --git a/swad_message.h b/swad_message.h index c1807be73..9fceacc7d 100644 --- a/swad_message.h +++ b/swad_message.h @@ -110,6 +110,7 @@ void Msg_PutHiddenParamMsgCod (long MsgCod); void Msg_BanSenderWhenShowingMsgs (void); void Msg_UnbanSenderWhenShowingMsgs (void); void Msg_UnbanSenderWhenListingUsrs (void); +bool Msg_CheckIfUsrIsBanned (long FromUsrCod,long ToUsrCod); void Msg_RemoveUsrFromBanned (long UsrCod); void Msg_ListBannedUsrs (void); diff --git a/swad_record.c b/swad_record.c index dcea53267..cb386d95f 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2467,6 +2467,7 @@ static void Rec_PutIconsCommands (void) extern const char *Txt_Follow; bool ItsMe = Usr_ItsMe (Gbl.Record.UsrDat->UsrCod); bool ICanViewUsrProfile; + bool RecipientHasBannedMe; Act_Action_t NextAction; if (!Gbl.Form.Inside && // Only if not inside another form @@ -2598,9 +2599,12 @@ static void Rec_PutIconsCommands (void) QR_PutLinkToPrintQRCode (ActPrnUsrQR,Rec_PutParamUsrCodEncrypted); /***** Button to send a message *****/ - Lay_PutContextualLinkOnlyIcon (ActReqMsgUsr,NULL,Rec_PutParamsMsgUsr, - "envelope.svg", - Txt_Write_a_message); + RecipientHasBannedMe = Msg_CheckIfUsrIsBanned (Gbl.Usrs.Me.UsrDat.UsrCod, // From: + Gbl.Record.UsrDat->UsrCod); // To: + if (!RecipientHasBannedMe) + Lay_PutContextualLinkOnlyIcon (ActReqMsgUsr,NULL,Rec_PutParamsMsgUsr, + "envelope.svg", + Txt_Write_a_message); /***** Button to follow / unfollow *****/ if (!ItsMe) // Not me