swad-core/swad_message.h

118 lines
4.5 KiB
C
Raw Normal View History

2014-12-01 23:55:08 +01:00
// swad_message.h: messages between users
#ifndef _SWAD_MSG
#define _SWAD_MSG
/*
SWAD (Shared Workspace At a Distance in Spanish),
is a web platform developed at the University of Granada (Spain),
and used to support university teaching.
This file is part of SWAD core.
2017-01-13 01:51:23 +01:00
Copyright (C) 1999-2017 Antonio Ca<EFBFBD>as Vargas
2014-12-01 23:55:08 +01:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*****************************************************************************/
/********************************** Headers **********************************/
/*****************************************************************************/
#include "swad_statistic.h"
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
2017-03-07 19:55:29 +01:00
#define Msg_MAX_CHARS_FILTER_CONTENT (128 - 1)
#define Msg_MAX_BYTES_FILTER_CONTENT (Msg_MAX_CHARS_FILTER_CONTENT * Str_MAX_BYTES_PER_CHAR)
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/******************************** Public types *******************************/
/*****************************************************************************/
2016-11-07 12:31:14 +01:00
#define Msg_NUM_TYPES_OF_MSGS 2
2014-12-01 23:55:08 +01:00
typedef enum
{
Msg_MESSAGES_RECEIVED,
Msg_MESSAGES_SENT,
} Msg_TypeOfMessages_t;
typedef enum
{
Msg_STATUS_ALL,
Msg_STATUS_DELETED,
Msg_STATUS_NOTIFIED,
} Msg_Status_t;
/*****************************************************************************/
/****************************** Public prototypes ****************************/
/*****************************************************************************/
void Msg_FormMsgUsrs (void);
2016-07-01 14:40:01 +02:00
void Msg_PutHiddenParamsSubjectAndContent (void);
2015-03-03 19:21:59 +01:00
void Msg_PutHiddenParamAnotherRecipient (const struct UsrData *UsrDat);
void Msg_PutHiddenParamOtherRecipients (void);
2014-12-01 23:55:08 +01:00
void Msg_RecMsgFromUsr (void);
void Msg_ReqDelAllRecMsgs (void);
void Msg_ReqDelAllSntMsgs (void);
void Msg_DelAllRecMsgs (void);
void Msg_DelAllSntMsgs (void);
void Msg_GetParamMsgsCrsCod (void);
void Msg_GetParamFilterFromTo (void);
void Msg_GetParamFilterContent (void);
void Msg_DelSntMsg (void);
void Msg_DelRecMsg (void);
void Msg_ExpSntMsg (void);
void Msg_ExpRecMsg (void);
void Msg_ConSntMsg (void);
void Msg_ConRecMsg (void);
void Msg_SetReceivedMsgAsOpen (long MsgCod,long UsrCod);
void Msg_DelAllRecAndSntMsgsUsr (long UsrCod);
void Msg_MoveUnusedMsgsContentToDeleted (void);
2014-12-17 23:04:35 +01:00
void Msg_ShowSntMsgs (void);
void Msg_ShowRecMsgs (void);
2014-12-01 23:55:08 +01:00
unsigned Msg_GetNumMsgsSentByTchsCrs (long CrsCod);
2015-03-14 02:26:59 +01:00
unsigned long Msg_GetNumMsgsSentByUsr (long UsrCod);
2014-12-01 23:55:08 +01:00
unsigned Msg_GetNumMsgsSent (Sco_Scope_t Scope,Msg_Status_t MsgStatus);
unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus);
2016-03-21 14:50:23 +01:00
2014-12-01 23:55:08 +01:00
void Msg_PutHiddenParamsMsgsFilters (void);
2016-11-07 12:31:14 +01:00
void Msg_GetDistinctCoursesInMyMessages (void);
void Msg_ShowFormSelectCourseSentOrRecMsgs (void);
void Msg_ShowFormToFilterMsgs (void);
2017-01-17 03:10:43 +01:00
void Msg_GetMsgSubject (long MsgCod,char Subject[Cns_MAX_BYTES_SUBJECT + 1]);
2017-03-06 13:01:16 +01:00
void Msg_GetNotifMessage (char SummaryStr[Cns_MAX_BYTES_SUMMARY_STRING + 1],
char **ContentStr,long MsgCod,bool GetContent);
2014-12-01 23:55:08 +01:00
void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg);
2015-12-05 21:15:30 +01:00
void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
2014-12-01 23:55:08 +01:00
const char *Style,bool Enabled,const char *BgColor);
bool Msg_WriteCrsOrgMsg (long CrsCod);
void Msg_WriteListUsrsDstMsg (long MsgCod);
2015-10-24 20:12:03 +02:00
void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassBackground);
2014-12-01 23:55:08 +01:00
void Msg_WriteMsgContent (char *Content,unsigned long MaxLength,bool InsertLinks,bool ChangeBRToRet);
void Msg_PutHiddenParamMsgCod (long MsgCod);
void Msg_BanSenderWhenShowingMsgs (void);
void Msg_UnbanSenderWhenShowingMsgs (void);
void Msg_UnbanSenderWhenListingUsrs (void);
void Msg_RemoveUsrFromBanned (long UsrCod);
void Msg_ListBannedUsrs (void);
#endif