# The Red Matrix: include/diaspora.php File Reference

All Classes Namespaces Files Functions Variables Pages
diaspora.php File Reference

## Functions

| diaspora_dispatch_public ($msg)
| diaspora_dispatch ($importer, $msg, $attempt=1)
| diaspora_is_blacklisted ($s)
| diaspora_process_outbound ($arr)
| diaspora_handle_from_contact ($contact_hash)
| diaspora_get_contact_by_handle ($uid, $handle)
| find_diaspora_person_by_handle ($handle)
| get_diaspora_key ($handle)
| diaspora_pubmsg_build ($msg, $channel, $contact, $prvkey, $pubkey)
| diaspora_msg_build ($msg, $channel, $contact, $prvkey, $pubkey, $public=false)
| diaspora_decode ($importer, $xml)
| diaspora_request ($importer, $xml)
| diaspora_post ($importer, $xml, $msg)
| diaspora_reshare ($importer, $xml, $msg)
| diaspora_asphoto ($importer, $xml, $msg)
| diaspora_comment ($importer, $xml, $msg)
| diaspora_conversation ($importer, $xml, $msg)
| diaspora_message ($importer, $xml, $msg)
| diaspora_photo ($importer, $xml, $msg, $attempt=1)
| diaspora_like ($importer, $xml, $msg)
| diaspora_retraction ($importer, $xml)
| diaspora_signed_retraction ($importer, $xml, $msg)
| diaspora_profile ($importer, $xml, $msg)
| diaspora_share ($owner, $contact)
| diaspora_unshare ($owner, $contact)
| diaspora_send_status ($item, $owner, $contact, $public_batch=false)
| diaspora_is_reshare ($body)
| diaspora_send_images ($item, $owner, $contact, $images, $public_batch=false)
| diaspora_send_followup ($item, $owner, $contact, $public_batch=false)
| diaspora_send_relay ($item, $owner, $contact, $public_batch=false)
| diaspora_send_retraction ($item, $owner, $contact, $public_batch=false)
| diaspora_send_mail ($item, $owner, $contact)
| diaspora_transmit ($owner, $contact, $slap, $public_batch, $queue_run=false)

## Function Documentation

diaspora_asphoto | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_comment | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_conversation | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_decode | ( |  | $importer,
|  |  | $xml
| ) |  |

diaspora_decode($importer,$xml) array $importer -> from user table string $xml -> urldecoded Diaspora salmon

Returns array 'message' -> decoded Diaspora XML message 'author' -> author diaspora handle 'key' -> author public key (converted to pkcs#8)

Author and key are used elsewhere to save a lookup for verifying replies and likes

     $decrypted now contains something like

      <decrypted_header>
         <iv>8e+G2+ET8l5BPuW0sVTnQw==</iv>
         <aes_key>UvSMb4puPeB14STkcDWq+4QE302Edu15oaprAQSkLKU=</aes_key>

OBSOLETE

         <author>
           <name>Ryan Hughes</name>
           <uri>acct:galaxor@diaspora.pirateship.org</uri>
         </author>

CURRENT

         <author_id>galaxor@diaspora.priateship.org</author_id>

END DIFFS

      </decrypted_header>

Referenced by receive_post().

diaspora_dispatch | ( |  | $importer,
|  |  | $msg,
|  |  | $attempt = `1`
| ) |  |

Referenced by diaspora_dispatch_public(), and receive_post().

diaspora_dispatch_public | ( |  | $msg | ) |

Referenced by receive_post().

diaspora_get_contact_by_handle | ( |  | $uid,
|  |  | $handle
| ) |  |

Referenced by diaspora_asphoto(), diaspora_comment(), diaspora_conversation(), diaspora_like(), diaspora_message(), diaspora_photo(), diaspora_post(), diaspora_profile(), diaspora_request(), diaspora_reshare(), diaspora_retraction(), and diaspora_signed_retraction().

diaspora_handle_from_contact | ( |  | $contact_hash | ) |

Referenced by diaspora_send_relay().

diaspora_is_blacklisted | ( |  | $s | ) |

Referenced by diaspora_get_contact_by_handle(), and find_diaspora_person_by_handle().

diaspora_is_reshare | ( |  | $body | ) |

Referenced by diaspora_send_status().

diaspora_like | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_message | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_msg_build | ( |  | $msg,
|  |  | $channel,
|  |  | $contact,
|  |  | $prvkey,
|  |  | $pubkey,
|  |  | $public = `false`
| ) |  |

Referenced by diaspora_send_followup(), diaspora_send_images(), diaspora_send_mail(), diaspora_send_relay(), diaspora_send_retraction(), diaspora_send_status(), diaspora_share(), and diaspora_unshare().

diaspora_photo | ( |  | $importer,
|  |  | $xml,
|  |  | $msg,
|  |  | $attempt = `1`
| ) |  |

Referenced by diaspora_dispatch().

diaspora_post | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_process_outbound | ( |  | $arr | ) |

Referenced by notifier_run().

diaspora_profile | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_pubmsg_build | ( |  | $msg,
|  |  | $channel,
|  |  | $contact,
|  |  | $prvkey,
|  |  | $pubkey
| ) |  |

Referenced by diaspora_msg_build().

diaspora_request | ( |  | $importer,
|  |  | $xml
| ) |  |

If there is a default group for this channel, add this member to it

Referenced by diaspora_dispatch().

diaspora_reshare | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_retraction | ( |  | $importer,
|  |  | $xml
| ) |  |

Referenced by diaspora_dispatch().

diaspora_send_followup | ( |  | $item,
|  |  | $owner,
|  |  | $contact,
|  |  | $public_batch = `false`
| ) |  |

Referenced by diaspora_process_outbound().

diaspora_send_images | ( |  | $item,
|  |  | $owner,
|  |  | $contact,
|  |  | $images,
|  |  | $public_batch = `false`
| ) |  |

Referenced by diaspora_send_status().

diaspora_send_mail | ( |  | $item,
|  |  | $owner,
|  |  | $contact
| ) |  |

Referenced by diaspora_process_outbound().

diaspora_send_relay | ( |  | $item,
|  |  | $owner,
|  |  | $contact,
|  |  | $public_batch = `false`
| ) |  |

Referenced by diaspora_process_outbound().

diaspora_send_retraction | ( |  | $item,
|  |  | $owner,
|  |  | $contact,
|  |  | $public_batch = `false`
| ) |  |

Referenced by diaspora_process_outbound().

diaspora_send_status | ( |  | $item,
|  |  | $owner,
|  |  | $contact,
|  |  | $public_batch = `false`
| ) |  |

Referenced by diaspora_process_outbound().

diaspora_share | ( |  | $owner,
|  |  | $contact
| ) |  |

Referenced by diaspora_request(), and notifier_run().

diaspora_signed_retraction | ( |  | $importer,
|  |  | $xml,
|  |  | $msg
| ) |  |

Referenced by diaspora_dispatch().

diaspora_transmit | ( |  | $owner,
|  |  | $contact,
|  |  | $slap,
|  |  | $public_batch,
|  |  | $queue_run = `false`
| ) |  |

Referenced by diaspora_send_followup(), diaspora_send_images(), diaspora_send_mail(), diaspora_send_relay(), diaspora_send_retraction(), diaspora_send_status(), diaspora_share(), and diaspora_unshare().

diaspora_unshare | ( |  | $owner,
|  |  | $contact
| ) |  |

find_diaspora_person_by_handle | ( |  | $handle | ) |

Referenced by diaspora_comment(), diaspora_conversation(), diaspora_like(), diaspora_message(), diaspora_request(), diaspora_reshare(), and get_diaspora_key().

get_diaspora_key | ( |  | $handle | ) |

Referenced by diaspora_decode().