[Thread Prev][Thread Next][Thread Index]
[PilotMgr] PilotManager SyncAB+BBDB
- To: bbdb-info@xxxxxxxxxxxxxxxxxxxxx, pilotmgr@xxxxxxxxxxxxxxxxxxxx
- Subject: [PilotMgr] PilotManager SyncAB+BBDB
- From: Aldo Valente <aldo@xxxxxxxxxxxxxxxx>
- Date: Wed, 20 Sep 2000 08:02:46 +0200 (CEST)
- Sender: owner-pilotmgr@xxxxxxxxxxxxxxxxxxxx
Hello,
perhaps some of you are using my patch for "syncing" the BBDB with the
Pilot's AddressDB via Pilotmanager. While Dinesh's and Thomas'
patches can really sync, my patch just throw away changed records in
the Palm -- which of course can be a problem. But at least for me it
is more important to have more control of the Data feeded to the
pilot.
Yesterday i hacked PilotSync.pm to send the Pilot updated Records via
Mail. Changing Addresses in the Pilot now results in Mails like this,
faking the From makes BBDB hopefully popup the specified Record. As
E-Mail is the normal way to feed Data to the BBDB, this should be
comfortable enough.
|Reply-To: aldo@xxxxxxxxxxxxxxxx
|From: "Vorname X. Nachname" <>
|To: aldo@xxxxxxxxxxxxxxxx
|Subject: Address Changed in Your BBDB
|Date: Wed, 20 Sep 2000 07:50:22 +0200
|
|This is a Auto Generated Mail from PilotManager+BBBD
|The following Address has changed in ypur Pilot
|Please adjust Your BBDB, otherwise yyoouu''llll lloooossee tthhiiss iinnffoorrmmaattiioonn!!
|
|Palm Category: work
|Vorname X. Nachname AKA Anton
|Company: MeineFirma
|
|Home: +49-190-66 66 66
|Work: 0815
|Other: 01234567
|Other: 09382472357
|E-Mail: me@xxxxxxx
|Holzweg 1
|53000 Bonn
|Birthday: 31.2.1959
|Notes: Kommentar
|Custom 3:
|Custom 4:
|Note:
| Geliebte: 72346728333
|Arbeitsstätte
|Auf dem Mühsal 13
|Unrastatt
|47011
|
|
|you@bar
Perhaps i should alter the record format in respect to bbdb-snarf, but
bbdb-snarf uses the US Style of formatted Addresses.
Be careful, this patch is ALPHA. Suggestions and diffs are welcome.
Aldo
--- /usr/local/pilotmgr/lib/porl5/PilotSync.pm Wed Apr 21 20:12:41 1999
+++ /usr/local/pilotmgr/PilotSync.pm Tue Sep 19 23:59:59 2000
@@ -380,6 +380,70 @@
}
}
+sub notify_user
+ ## Aldo Valente, 19.9.2000
+ ## VERY Ugly sub for submitting changes in the Pilot to
+ ## the User via mail
+ ## Only needed for my BBBD Syncing patch, which doesn't sync ;-)
+ ## Todo: check if REALLY SyncAB+BBDB is working.
+ {
+ my ($i, $j);
+ my $frec = $_[0];
+ my @PhoneType = ( 'Work',
+ 'Home',
+ 'Fax',
+ 'Other',
+ 'E-Mail',
+ 'Main',
+ 'PAGER',
+ 'Mobil' );
+
+# Take this, if you don't have sendmail
+# open (MAIL, "|mail -s \"Pilot BBDB Update\" $ENV{'USER'}");
+
+ open (MAIL, "|/usr/sbin/sendmail -oi -t");
+ # We're faking From, to let the BBBD show the right record
+ print MAIL "To: $ENV{'USER'}\n";
+ print MAIL "From: $frec->{'entry'}->[1] $frec->{'entry'}->[0] <>\n";
+ print MAIL "Reply-To: $ENV{'USER'}\n";
+ print MAIL "Subject: Address Changed in Your BBDB\n\n";
+
+ print MAIL "This is a Auto Generated Mail from PilotManager+BBBD\n";
+ print MAIL "The following Address has changed in ypur Pilot\n";
+ print MAIL "Please adjust Your BBDB, otherwise yyoouu''llll lloooossee tthhiiss iinnffoorrmmaattiioonn!!\n\n";
+ print MAIL "Palm Category: ${$masterdb->{'__APPINFO'}{'categoryName'}}[ $frec->{'category'} ]\n"; # Cat
+ print MAIL "$frec->{'entry'}->[1] $frec->{'entry'}->[0]";
+ print MAIL " AKA $frec->{'entry'}->[13]" if $frec->{'entry'}->[13];
+ print MAIL "\n";
+ print MAIL "Company: $frec->{'entry'}->[2]\n" if $frec->{'entry'}->[2];
+ print MAIL "\n";
+ for $i (3..7) {
+ next unless $frec->{'entry'}->[$i];
+ print MAIL $PhoneType[ shift @{$frec->{'phoneLabel'} }];
+ print MAIL ": $frec->{'entry'}->[$i]\n";
+ }
+
+ print MAIL "$frec->{'entry'}->[8]\n" if $frec->{'entry'}->[8]; # Adress
+ print MAIL "$frec->{'entry'}->[11] $frec->{'entry'}->[9]\n"
+ if $frec->{'entry'}->[11] . $frec->{'entry'}->[9]; # ZIP/City
+ print MAIL "$frec->{'entry'}->[10]\n"
+ if $frec->{'entry'}->[10]; # State
+ print MAIL "$frec->{'entry'}->[12]\n"
+ if $frec->{'entry'}->[10]; # Country
+ ## Custom
+ print MAIL $masterdb->{'__APPINFO'}{'label'}[14];
+ print MAIL ": $frec->{'entry'}->[14]\n"; # C1
+ print MAIL $masterdb->{'__APPINFO'}{'label'}[15];
+ print MAIL ": $frec->{'entry'}->[15]\n"; # C2
+ print MAIL $masterdb->{'__APPINFO'}{'label'}[16];
+ print MAIL ": $frec->{'entry'}->[16]\n"; # C3
+ print MAIL $masterdb->{'__APPINFO'}{'label'}[17];
+ print MAIL ": $frec->{'entry'}->[17]\n"; # C4
+
+ print MAIL "Note:\n $frec->{'entry'}->[18]\n"; # Note
+
+ }
+
sub syncRecord
{
my ($mrec, $frec, $prec, $dlp, $dbh, $rule) = @_;
@@ -461,9 +525,10 @@
PilotMgr::msg('Update Pilot: ' . &$gNameHook($prec));
}
if ($fchange)
- {
- PilotMgr::msg('Update File: ' . &$gNameHook($frec));
- }
+ { ### Aldo
+ PilotMgr::msg('Update File:' . &$gNameHook($frec));
+ ¬ify_user($frec);
+ }
}
if ($rule == 1 or $rule == 9)
@@ -512,7 +577,8 @@
©Rec($prec, $frec);
PilotMgr::msg('Update File: ' . &$gNameHook($prec));
-
+ ### Aldo
+ ¬ify_user($frec);
$master_db->{$prec->{'id'}} = $frec;
$master_db->{$gIdField . '_' . $frec->{$gIdField}} = $prec->{'id'}
unless (defined $mrec);
@@ -540,7 +606,7 @@
delete $file_db->{$mrec->{$gIdField}};
$file_sizechange = -1;
PilotMgr::msg('Delete File: ' . &$gNameHook($mrec));
-
+ ### Aldo: Todo
for (; $id < @{$file_db->{'__RECORDS'}}; $id++)
{
$file_db->{ $file_db->{'__RECORDS'}->[$id]->{$gIdField} }--;
|
|