| Conditions | 4 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 24 | public function getInitConvs(){ |
||
| 25 | $contacts = $this->app->getContacts(); |
||
| 26 | $contacts = $contacts['contacts']; |
||
| 27 | $currentUser = $this->app->getCurrentUser(); |
||
| 28 | $currentUserId = $currentUser['id']; |
||
| 29 | $initConvs = array(); |
||
| 30 | foreach($contacts as $contact) { |
||
| 31 | foreach ($contact['backends'] as $backend) { |
||
| 32 | if ($backend['id'] === 'xmpp') { |
||
| 33 | $jid = $backend['value']; |
||
| 34 | $initConvs[$jid] = array( |
||
| 35 | "id" => $jid, |
||
| 36 | "users" => array( |
||
| 37 | $contact['id'], |
||
| 38 | $currentUserId |
||
| 39 | ), |
||
| 40 | "backend" => 'xmpp', |
||
| 41 | "messages" => array(), |
||
| 42 | "files" => array() |
||
| 43 | ); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 | return $initConvs; |
||
| 48 | } |
||
| 49 | |||
| 72 | } |