mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-16 05:34:12 +02:00
Version 15.97.5
This commit is contained in:
parent
c03a8a2c8e
commit
66b0edb994
|
@ -118,13 +118,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.97.4 (2016-01-04)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.97.5 (2016-01-04)"
|
||||
#define CSS_FILE "swad15.97.css"
|
||||
#define JS_FILE "swad15.77.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.97.5: Jan 04, 2016 Button to remove a social note is not shown if author already removed the note (but it yet exists because another user shared it). (190763 lines)
|
||||
Version 15.97.4: Jan 04, 2016 Guests can see and write in global forums. (190758 lines)
|
||||
Version 15.97.3: Jan 04, 2016 Link to user's privacy in my public profile. (190755 lines)
|
||||
Version 15.97.2: Jan 04, 2016 New option in user's privacy. (190743 lines)
|
||||
|
|
|
@ -167,7 +167,7 @@ static void Soc_RemoveASocialPublishingFromDB (const struct SocialPublishing *So
|
|||
const struct SocialNote *SocNot);
|
||||
static void Soc_CheckAndDeleteASocialNoteFromDB (const struct SocialNote *SocNot);
|
||||
|
||||
static bool Soc_CheckIfNoteIsYetPublishedByMe (long NotCod);
|
||||
static bool Soc_CheckIfNoteIsPublishedInTimelineByUsr (long NotCod,long UsrCod);
|
||||
static unsigned long Soc_GetNumPubsOfANote (long NotCod);
|
||||
static void Soc_GetNumTimesANoteHasBeenShared (struct SocialNote *SocNot);
|
||||
static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot);
|
||||
|
@ -529,7 +529,7 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
|
|||
Soc_PutIconShared ();
|
||||
else // I am not the author && not unavailable
|
||||
{
|
||||
if (Soc_CheckIfNoteIsYetPublishedByMe (SocNot->NotCod))
|
||||
if (Soc_CheckIfNoteIsPublishedInTimelineByUsr (SocNot->NotCod,Gbl.Usrs.Me.UsrDat.UsrCod))
|
||||
// I have yet published this social note
|
||||
/* Put icon to unshare this publishing */
|
||||
Soc_PutFormToUnshareSocialPublishing (SocPub->PubCod);
|
||||
|
@ -546,6 +546,7 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
|
|||
if (WritingTimeline &&
|
||||
Gbl.Usrs.Me.Logged &&
|
||||
UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // I am the author
|
||||
if (Soc_CheckIfNoteIsPublishedInTimelineByUsr (SocNot->NotCod,SocNot->UsrCod))
|
||||
/* Put icon to remove this publishing */
|
||||
Soc_PutFormToRemoveSocialPublishing (SocPub->PubCod);
|
||||
|
||||
|
@ -1311,7 +1312,7 @@ static void Soc_ShareSocialNote (void)
|
|||
if (ICanShare)
|
||||
{
|
||||
/***** Check if I have yet shared this social note *****/
|
||||
IHavePublishedThisNote = Soc_CheckIfNoteIsYetPublishedByMe (SocNot.NotCod);
|
||||
IHavePublishedThisNote = Soc_CheckIfNoteIsPublishedInTimelineByUsr (SocNot.NotCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
if (!IHavePublishedThisNote)
|
||||
{
|
||||
/***** Share (publish social note in timeline) *****/
|
||||
|
@ -1487,6 +1488,8 @@ static void Soc_RequestRemovalSocialPublishing (void)
|
|||
ICanRemove = (Gbl.Usrs.Me.Logged &&
|
||||
SocPub.PublisherCod == Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
if (ICanRemove)
|
||||
{
|
||||
if (Soc_CheckIfNoteIsPublishedInTimelineByUsr (SocNot.NotCod,SocNot.UsrCod))
|
||||
{
|
||||
/***** Form to ask for confirmation to remove this social post *****/
|
||||
/* Start form */
|
||||
|
@ -1514,6 +1517,7 @@ static void Soc_RequestRemovalSocialPublishing (void)
|
|||
Act_FormEnd ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************ Remove a social publishing *************************/
|
||||
|
@ -1640,17 +1644,17 @@ static void Soc_CheckAndDeleteASocialNoteFromDB (const struct SocialNote *SocNot
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***** Check if I have published a social note (I authored or shared it) *****/
|
||||
/**************** Check if a user has published a social note ****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static bool Soc_CheckIfNoteIsYetPublishedByMe (long NotCod)
|
||||
static bool Soc_CheckIfNoteIsPublishedInTimelineByUsr (long NotCod,long UsrCod)
|
||||
{
|
||||
char Query[128];
|
||||
|
||||
sprintf (Query,"SELECT COUNT(*) FROM social_timeline"
|
||||
" WHERE NotCod='%ld' AND PublisherCod='%ld'",
|
||||
NotCod,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||
return (DB_QueryCOUNT (Query,"can not check if you have published a social note") != 0);
|
||||
NotCod,UsrCod);
|
||||
return (DB_QueryCOUNT (Query,"can not check if a user has published a social note") != 0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Reference in New Issue
Block a user