Version 16.155.12

This commit is contained in:
Antonio Cañas Vargas 2017-03-12 12:52:40 +01:00
parent 20e22eb3b4
commit 9de3b7d774
4 changed files with 47 additions and 36 deletions

View File

@ -207,14 +207,15 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.155.11 (2017-03-11)" #define Log_PLATFORM_VERSION "SWAD 16.155.12 (2017-03-12)"
#define CSS_FILE "swad16.147.css" #define CSS_FILE "swad16.147.css"
#define JS_FILE "swad16.144.js" #define JS_FILE "swad16.144.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/* /*
Version 16.155.11:Mar 11, 2017 Adjusting size of database fields. (? lines) Version 16.155.12:Mar 12, 2017 Fixed bug while sending a message to several users, reported by Javier Fernández Baldomero. (216721 lines)
Version 16.155.11:Mar 11, 2017 Adjusting size of database fields. (216711 lines)
1 change necessary in database: 1 change necessary in database:
ALTER TABLE forum_post CHANGE COLUMN ImageTitle ImageTitle VARCHAR(2047) NOT NULL; ALTER TABLE forum_post CHANGE COLUMN ImageTitle ImageTitle VARCHAR(2047) NOT NULL;

View File

@ -1182,11 +1182,11 @@ mysql> DESCRIBE forum_thr_clip;
3 rows in set (0.00 sec) 3 rows in set (0.00 sec)
*/ */
DB_CreateTable ("CREATE TABLE IF NOT EXISTS forum_thr_clip (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS forum_thr_clip ("
"ThrCod INT NOT NULL," "ThrCod INT NOT NULL,"
"UsrCod INT NOT NULL," "UsrCod INT NOT NULL,"
"TimeInsert TIMESTAMP NOT NULL," "TimeInsert TIMESTAMP NOT NULL,"
"UNIQUE INDEX(ThrCod)," "UNIQUE INDEX(ThrCod),"
"UNIQUE INDEX(UsrCod))"); "UNIQUE INDEX(UsrCod))");
/***** Table forum_thr_read *****/ /***** Table forum_thr_read *****/
/* /*
@ -1201,10 +1201,10 @@ mysql> DESCRIBE forum_thr_read;
3 rows in set (0.00 sec) 3 rows in set (0.00 sec)
*/ */
DB_CreateTable ("CREATE TABLE IF NOT EXISTS forum_thr_read (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS forum_thr_read ("
"ThrCod INT NOT NULL," "ThrCod INT NOT NULL,"
"UsrCod INT NOT NULL," "UsrCod INT NOT NULL,"
"ReadTime DATETIME NOT NULL," "ReadTime DATETIME NOT NULL,"
"UNIQUE INDEX(ThrCod,UsrCod))"); "UNIQUE INDEX(ThrCod,UsrCod))");
/***** Table forum_thread *****/ /***** Table forum_thread *****/
/* /*
@ -1221,16 +1221,16 @@ mysql> DESCRIBE forum_thread;
5 rows in set (0.00 sec) 5 rows in set (0.00 sec)
*/ */
DB_CreateTable ("CREATE TABLE IF NOT EXISTS forum_thread (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS forum_thread ("
"ThrCod INT NOT NULL AUTO_INCREMENT," "ThrCod INT NOT NULL AUTO_INCREMENT,"
"ForumType TINYINT NOT NULL," "ForumType TINYINT NOT NULL,"
"Location INT NOT NULL DEFAULT -1," "Location INT NOT NULL DEFAULT -1,"
"FirstPstCod INT NOT NULL," "FirstPstCod INT NOT NULL,"
"LastPstCod INT NOT NULL," "LastPstCod INT NOT NULL,"
"UNIQUE INDEX(ThrCod)," "UNIQUE INDEX(ThrCod),"
"INDEX(ForumType)," "INDEX(ForumType),"
"INDEX(Location)," "INDEX(Location),"
"UNIQUE INDEX(FirstPstCod)," "UNIQUE INDEX(FirstPstCod),"
"UNIQUE INDEX(LastPstCod))"); "UNIQUE INDEX(LastPstCod))");
/***** Table hidden_params *****/ /***** Table hidden_params *****/
/* /*

View File

@ -718,7 +718,6 @@ void Msg_RecMsgFromUsr (void)
Content,Cns_MAX_BYTES_LONG_TEXT,false); Content,Cns_MAX_BYTES_LONG_TEXT,false);
Ptr = Gbl.Usrs.Select.All; Ptr = Gbl.Usrs.Select.All;
NumRecipients = 0; NumRecipients = 0;
while (*Ptr) while (*Ptr)
{ {
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDstData.EncryptedUsrCod,Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64); Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDstData.EncryptedUsrCod,Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64);

View File

@ -5248,7 +5248,7 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
{ {
ListUsrCods.NumUsrs = 1; ListUsrCods.NumUsrs = 1;
Usr_AllocateListUsrCods (&ListUsrCods); Usr_AllocateListUsrCods (&ListUsrCods);
ListUsrCods.Lst[0] = Gbl.Usrs.Other.UsrDat.UsrCod; ListUsrCods.Lst[0] = UsrDat.UsrCod;
} }
else else
{ {
@ -5339,23 +5339,34 @@ bool Usr_GetListMsgRecipientsWrittenExplicitelyBySender (bool WriteErrorMsgs)
/* Find if encrypted user's code is already in list */ /* Find if encrypted user's code is already in list */
if (!Usr_FindUsrCodInListOfSelectedUsrs (UsrDat.EncryptedUsrCod)) // If not in list ==> add it if (!Usr_FindUsrCodInListOfSelectedUsrs (UsrDat.EncryptedUsrCod)) // If not in list ==> add it
{ {
LengthUsrCod = strlen (UsrDat.EncryptedUsrCod);
/* Add encrypted user's code to list of users */ /* Add encrypted user's code to list of users */
if (LengthSelectedUsrsCods == 0) // First user in list if (LengthSelectedUsrsCods == 0) // First user in list
{ {
if (strlen (UsrDat.EncryptedUsrCod) < Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS) if (LengthUsrCod < Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS)
Str_Copy (Gbl.Usrs.Select.All,UsrDat.EncryptedUsrCod,
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS); // Add first user
}
else // Not first user in list
{
LengthUsrCod = strlen (UsrDat.EncryptedUsrCod);
if (LengthSelectedUsrsCods + (1 + LengthUsrCod) < Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS)
{ {
// Add another user /* Add user */
Str_Copy (Gbl.Usrs.Select.All,
UsrDat.EncryptedUsrCod,
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
LengthSelectedUsrsCods = LengthUsrCod;
}
}
else // Not first user in list
{
if (LengthSelectedUsrsCods + (1 + LengthUsrCod) <
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS)
{
/* Add separator */
Gbl.Usrs.Select.All[LengthSelectedUsrsCods] = Par_SEPARATOR_PARAM_MULTIPLE; Gbl.Usrs.Select.All[LengthSelectedUsrsCods] = Par_SEPARATOR_PARAM_MULTIPLE;
Str_Concat (Gbl.Usrs.Select.All,UsrDat.EncryptedUsrCod, LengthSelectedUsrsCods++;
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
LengthSelectedUsrsCods += 1 + LengthUsrCod; /* Add user */
Str_Copy (Gbl.Usrs.Select.All + LengthSelectedUsrsCods,
UsrDat.EncryptedUsrCod,
Usr_MAX_BYTES_LIST_ENCRYPTED_USR_CODS);
LengthSelectedUsrsCods += LengthUsrCod;
} }
} }
} }