]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't bother with subscription hoohaw; just ask the user to do it
authorEvan Prodromou <evan@controlezvous.ca>
Thu, 26 Jun 2008 20:31:03 +0000 (16:31 -0400)
committerEvan Prodromou <evan@controlezvous.ca>
Thu, 26 Jun 2008 20:31:03 +0000 (16:31 -0400)
darcs-hash:20080626203103-34904-19ef53bc734622a310a705608f3e227e2f387904.gz

actions/imsettings.php
db/laconica.sql
lib/jabber.php
xmppdaemon.php

index 90a4fd8074c077e4948984753f94482a33e96ecf..e471aafac5860760691382139b23357d569b289e 100644 (file)
@@ -73,7 +73,9 @@ class ImsettingsAction extends SettingsAction {
                        } else {
                                common_input('jabber', _t('IM Address'),
                                                        ($this->arg('jabber')) ? $this->arg('jabber') : NULL,
-                                                _t('Jabber or GTalk address, like "UserName@example.org"'));
+                                                _t('Jabber or GTalk address, like "UserName@example.org". ' .
+                                                   'Make sure to subscribe to ' . jabber_daemon_address() .
+                                                   ' before adding your IM address here.'));
                                common_submit('add', 'Add');
                        }
                }
@@ -192,21 +194,19 @@ class ImsettingsAction extends SettingsAction {
                        return;
                }
 
-               # XXX: optionally queue for offline sending
+               # XXX: queue for offline sending
 
-               if (!jabber_is_subscribed($jabber)) {
-                       jabber_special_presence('subscribe', $jabber);
-               } else {
-                       jabber_confirm_address($confirm->code,
-                                                                  $user->nickname,
-                                                                  $jabber);
-               }
+               jabber_confirm_address($confirm->code,
+                                                          $user->nickname,
+                                                          $jabber);
+
+               # XXX: I18N
+
+               $msg = 'A confirmation code was sent to the IM address you added. ' .
+                       ' You must approve ' . jabber_daemon_address() .
+                       ' for sending messages to you.';
 
-               $this->show_form(_t('A confirmation code was ' .
-                                   ' sent to the IM address you added. ' .
-                                   ' You must approve ' . jabber_daemon_address() .
-                                   ' for sending messages to you.'),
-                                   TRUE);
+               $this->show_form($msg, TRUE);
        }
 
        function cancel_confirmation() {
index f61d5de15d48cf6f148f61a14fd1ef59f477eca2..46424ecceb955493e7a1c578d7438e5112921bbf 100644 (file)
@@ -24,7 +24,7 @@ create table avatar (
     url varchar(255) unique key comment 'avatar location',
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     constraint primary key (profile_id, width, height),
     index avatar_profile_id_idx (profile_id)
 ) ENGINE=InnoDB;
@@ -45,7 +45,7 @@ create table user (
     password varchar(255) comment 'salted password, can be null for OpenID users',
     email varchar(255) unique key comment 'email address for password recovery etc.',
     jabber varchar(255) unique key comment 'jabber ID for notices',
-    jabbernotify tinyint default 0 comment 'whether to send notices to jabber',    
+    jabbernotify tinyint default 0 comment 'whether to send notices to jabber',
     updatefrompresence tinyint default 0 comment 'whether to record updates from Jabber presence notices',
     sms varchar(64) unique key comment 'sms phone number',
     carrier integer comment 'foreign key to sms_carrier' references sms_carrier (id),
@@ -97,7 +97,7 @@ create table notice (
 create table consumer (
     consumer_key varchar(255) primary key comment 'unique identifier, root URL',
     seed char(32) not null comment 'seed for new tokens by this consumer',
-    
+
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified'
 ) ENGINE=InnoDB;
@@ -108,10 +108,10 @@ create table token (
     secret char(32) not null comment 'secret value',
     type tinyint not null default 0 comment 'request or access',
     state tinyint default 0 comment 'for requests; 0 = initial, 1 = authorized, 2 = used',
-    
+
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     constraint primary key (consumer_key, tok)
 ) ENGINE=InnoDB;
 
@@ -120,10 +120,10 @@ create table nonce (
     tok char(32) not null comment 'identifying value',
     nonce char(32) not null comment 'nonce',
     ts datetime not null comment 'timestamp sent',
-    
+
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     constraint primary key (consumer_key, tok, nonce),
     constraint foreign key (consumer_key, tok) references token (consumer_key, tok)
 ) ENGINE=InnoDB;
@@ -136,7 +136,7 @@ create table user_openid (
     user_id integer not null comment 'user owning this URL' references user (id),
     created datetime not null comment 'date this record was created',
     modified timestamp comment 'date this record was modified',
-    
+
     index user_openid_user_id_idx (user_id)
 ) ENGINE=InnoDB;
 
index 8f23e75b5787a023ba6dbcf13875d7c61a2dca38..7630d8cd2039e4736522a83a0eed0d21a86c57d9 100644 (file)
@@ -142,8 +142,3 @@ function jabber_broadcast_notice($notice) {
 function jabber_format_notice(&$profile, &$notice) {
        return $profile->nickname . ': ' . $notice->content;
 }
-
-# Dike this out for now
-function jabber_is_subscribed($address) {
-       return false;
-}
index 3f2b575e4955a11d51ccc02daf54f410f7e2ae27..cc464f155e4de9d55f53937eaac166d694dc4469 100755 (executable)
@@ -194,30 +194,7 @@ class XMPPDaemon {
                                   'Accepted subscription from ' . $from);
                                break;
                        case 'subscribed':
-                               $confirm = $this->get_confirmation($from);
-                               if ($confirm) {
-                                       $user = User::staticGet($confirm->user_id);
-                                       if ($user) {
-                                               jabber_confirm_address($confirm->code,
-                                                                      $user->nickname,
-                                                                      $confirm->address);
-                                       } else {
-                                               $this->log(LOG_WARNING,
-                                                       'got unexpected subscribed message from ' . $from);
-                                       }
-                               }
                        case 'unsubscribed':
-                               $user = $this->get_user($from);
-                               if ($user) {
-                                       $this->set_notify($user, false);
-                               }
-
-                               $confirm = $this->get_confirmation($from);
-                               if ($confirm) {
-                                       $user = User::staticGet($confirm->user_id);
-                                       if ($user) {
-                                       }
-                               }
                        case 'unsubscribe':
                                $this->log(LOG_INFO,
                                   'Ignoring  "' . $pl['type'] . '" from ' . $from);