From 9bf4508ffb626d1aa2c9591b700e985b00abe577 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 1 Nov 2012 15:45:02 -0700 Subject: cleanup channel management --- include/identity.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index b0a99a744..ca20fd22e 100644 --- a/include/identity.php +++ b/include/identity.php @@ -55,7 +55,10 @@ function create_identity($arr) { $sig = base64url_encode(rsa_sign($guid,$key['prvkey'])); $hash = base64url_encode(hash('whirlpool',$guid . $sig,true)); - $primary = true; + $r = q("select channel_id from channel where channel_account_id = %d and channel_primary = 1 limit 1", + intval($arr['account_id']) + ); + $primary = (! $r) ? true : false; $r = q("insert into channel ( channel_account_id, channel_primary, channel_name, channel_address, channel_guid, channel_guid_sig, -- cgit v1.2.3