aboutsummaryrefslogtreecommitdiffstats
path: root/mod/notes.php
blob: e21e4386ca902cc622e8849bea72b2c058c7ec34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php /** @file */

function notes_init(&$a) {
	if(! local_user())
		return;
	logger('mod_notes: ' . print_r($_REQUEST,true));

	$ret = array('success' => true);
	if($_REQUEST['note_text'] || $_REQUEST['note_text'] == '') {
		$body = escape_tags($_REQUEST['note_text']);
		set_pconfig(local_user(),'notes','text',$body);
	}

	// push updates to channel clones

	if((argc() > 1) && (argv(1) === 'sync')) {
		require_once('include/zot.php');
		build_sync_packet();
	}

	logger('notes saved.');
	json_return_and_die($ret);
	
}