Proyectos de Subversion LeadersLinked - Services

Rev

Rev 197 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 197 Rev 198
Línea 1039... Línea 1039...
1039
        foreach ($paginator as $m) 
1039
        foreach ($paginator as $m) 
1040
        {
1040
        {
1041
            $report_message = false;
1041
            $report_message = false;
1042
            if($m->sender_id != $currentUser->id) {
1042
            if($m->sender_id != $currentUser->id) {
1043
                $report_message = in_array($m->sender_id, $user_blocked_ids);
1043
                $report_message = in_array($m->sender_id, $user_blocked_ids);
1044
            } else {
1044
                if(!$report_message) {
1045
                $report_message = in_array($m->id, $abuse_report_message_ids );
1045
                    $report_message = in_array($m->id, $abuse_report_message_ids );
-
 
1046
                }
1046
            }
1047
            } 
Línea 1047... Línea 1048...
1047
            
1048
            
1048
 
1049
 
1049
            if (isset($users[$m->sender_id])) {
1050
            if (isset($users[$m->sender_id])) {
Línea 1057... Línea 1058...
1057
                'code' => $userdata_from->uuid,
1058
                'code' => $userdata_from->uuid,
1058
                'type' => 'user',
1059
                'type' => 'user',
1059
                'filename' => $userdata_from->image
1060
                'filename' => $userdata_from->image
1060
            ],['force_canonical' => true]);
1061
            ],['force_canonical' => true]);
1061
            $u =  $userdata_from->id == $currentUser->id ? 1 : 2;
1062
            $u =  $userdata_from->id == $currentUser->id ? 1 : 2;
1062
            if ($m->type == ChatGroupMessage::TYPE_TEXT) {
-
 
1063
                $content = $this->sanitize($m->content);
-
 
1064
            } else {
-
 
1065
                $content = $this->url()->fromRoute('storage', ['code' => $chatGroup->uuid, 'type' => 'chat', 'filename' => $m->content],['force_canonical' => true]);
-
 
1066
            }
-
 
1067
            
1063
  
Línea 1068... Línea 1064...
1068
         
1064
         
1069
            
1065
            
1070
 
1066
 
1071
            if($report_message) {
1067
            if($report_message) {
1072
                $m->type = ChatGroupMessage::TYPE_TEXT;
1068
                $m->type = ChatGroupMessage::TYPE_TEXT;
Línea 1073... Línea 1069...
1073
                $content = 'LABEL_ABUSE_CONTENT_REPORTED'; 
1069
                $content = 'LABEL_ABUSE_CONTENT_REPORTED'; 
-
 
1070
                $url_abuse_report = '';
-
 
1071
            } else {
-
 
1072
            
-
 
1073
                $url_abuse_report = $this->url()->fromRoute('helpers/abuse-report', ['type' => 'chat-group-message', 'id' => $m->uuid], ['force_canonical' => true]);
-
 
1074
                if ($m->type == ChatGroupMessage::TYPE_TEXT) {
-
 
1075
                    $content = $this->sanitize($m->content);
1074
                $url_abuse_report = '';
1076
                } else {
Línea 1075... Línea 1077...
1075
            } else {
1077
                    $content = $this->url()->fromRoute('storage', ['code' => $chatGroup->uuid, 'type' => 'chat', 'filename' => $m->content],['force_canonical' => true]);
1076
            
1078
                }
1077
                $url_abuse_report = $this->url()->fromRoute('helpers/abuse-report', ['type' => 'chat-group-message', 'id' => $m->uuid], ['force_canonical' => true]);
1079
                
Línea 1153... Línea 1155...
1153
                $users[$to_id] = $userdata_to;
1155
                $users[$to_id] = $userdata_to;
1154
            }
1156
            }
Línea 1155... Línea 1157...
1155
 
1157
 
Línea 1156... Línea 1158...
1156
            $u = $m->from_id == $currentUser->id ? 1 : 2;
1158
            $u = $m->from_id == $currentUser->id ? 1 : 2;
1157
            
1159
            
1158
            
-
 
1159
            
1160
  
1160
            $url_abuse_report = '';
1161
           
1161
            $report_message = false;
1162
            $report_message = false;
Línea 1162... Línea 1163...
1162
            $seen = 0;
1163
            $seen = 0;
1163
            if ($m->to_id == $currentUser->id) {
1164
            if ($m->to_id == $currentUser->id) {
1164
            
-
 
1165
                if($abuse_report_message_ids) {
-
 
1166
                    $report_message = in_array($m->id, $abuse_report_message_ids );
1165
            
1167
                } else {
-
 
Línea 1168... Línea 1166...
1168
                    $url_abuse_report = $this->url()->fromRoute('helpers/abuse-report', ['type' => 'chat-message', 'id' => $m->uuid], ['force_canonical' => true]);
1166
                if($abuse_report_message_ids) {
1169
                }
1167
                    $report_message = in_array($m->id, $abuse_report_message_ids );
Línea 1170... Línea 1168...
1170
                
1168
                } 
1171
                
1169
                
1172
                $seen = $m->seen == ChatMessage::SEEN_NO ? 1 : 0;
1170
                $seen = $m->seen == ChatMessage::SEEN_NO ? 1 : 0;
1173
            }
1171
            }
1174
 
1172
 
1175
 
-
 
1176
 
1173
  
1177
            if ($report_message || $m->type == ChatMessage::TYPE_TEXT) {
-
 
1178
                if($report_message) {
1174
            
-
 
1175
            $url_abuse_report = '';
-
 
1176
            if ($report_message) {
-
 
1177
                $content = 'LABEL_ABUSE_CONTENT_REPORTED'; 
-
 
1178
                $m->type = ChatMessage::TYPE_TEXT;
-
 
1179
            } else {
-
 
1180
                if ($m->to_id == $currentUser->id) {
1179
                    $content = 'LABEL_ABUSE_CONTENT_REPORTED'; 
1181
                    $url_abuse_report = $this->url()->fromRoute('helpers/abuse-report', ['type' => 'chat-message', 'id' => $m->uuid], ['force_canonical' => true]);
-
 
1182
                }
1180
                } else {
1183
                if($m->type == ChatMessage::TYPE_TEXT) {
1181
                 $content = $this->sanitize($m->content);
1184
                    $content = $this->sanitize($m->content);
1182
                }
1185
                } else { 
1183
            } else {
1186
                    $content = $this->url()->fromRoute('storage', ['code' => $chatUser->uuid, 'type' => 'chat', 'filename' => $m->content],['force_canonical' => true]);
1184
                $content = $this->url()->fromRoute('storage', ['code' => $chatUser->uuid, 'type' => 'chat', 'filename' => $m->content],['force_canonical' => true]);
1187
                }
1185
            }
1188
            }
1186
 
1189