Commit 27b126ee authored by Robert Lyon's avatar Robert Lyon
Browse files

Count both inititing and accepting friends (Bug 1348428)

When counting 'make friends' towards progress bar

Change-Id: I50574ac5339b07d89e194f915f6feeded91e28fd
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
parent 30a3e92f
...@@ -334,10 +334,11 @@ class PluginArtefactInternal extends PluginArtefact { ...@@ -334,10 +334,11 @@ class PluginArtefactInternal extends PluginArtefact {
$meta->completed = $count[0]->completed; $meta->completed = $count[0]->completed;
break; break;
case 'makefriend': case 'makefriend':
// We count make friend as either initiating or accepting a friendship
$sql = "SELECT COUNT(*) AS completed $sql = "SELECT COUNT(*) AS completed
FROM {usr_friend} FROM {usr_friend}
WHERE usr1 = ?"; WHERE usr1 = ? OR usr2 = ?";
$count = get_records_sql_array($sql, array($USER->get('id'))); $count = get_records_sql_array($sql, array($USER->get('id'), $USER->get('id')));
$meta->completed = $count[0]->completed; $meta->completed = $count[0]->completed;
break; break;
default: default:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment