summaryrefslogtreecommitdiff
blob: 277b307ab2c7946d364727db5b91d0dd7f8329cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
diff -U3 -r --new-file kdenetwork-3.3.2/kopete/protocols/msn/Makefile.am kdenetwork-3.3.2-new/kopete/protocols/msn/Makefile.am
--- kdenetwork-3.3.2/kopete/protocols/msn/Makefile.am	2004-06-25 12:10:14.000000000 +0300
+++ kdenetwork-3.3.2-new/kopete/protocols/msn/Makefile.am	2005-05-21 14:06:36.000000000 +0300
@@ -1,3 +1,4 @@
+KDE_OPTIONS = nofinal
 METASOURCES = AUTO
 SUBDIRS = ui . icons config
 AM_CPPFLAGS = -I$(srcdir)/ui \
@@ -12,7 +13,8 @@
 
 libkopete_msn_shared_la_SOURCES = msnprotocol.cpp msnaccount.cpp msnaddcontactpage.cpp msncontact.cpp \
 	msnsocket.cpp msnmessagemanager.cpp msndebugrawcmddlg.cpp \
-	msnnotifysocket.cpp msnswitchboardsocket.cpp msnfiletransfersocket.cpp msninvitation.cpp msnp2p.cpp sha1.cpp
+	msnnotifysocket.cpp msnswitchboardsocket.cpp msnfiletransfersocket.cpp msninvitation.cpp msnp2p.cpp sha1.cpp \
+	sslloginhandler.cpp
 
 libkopete_msn_shared_la_LIBADD  = ./ui/libkopetemsnui.la ../../libkopete/libkopete.la $(LIB_KIO)
 libkopete_msn_shared_la_LDFLAGS = -version-info 0:0:0 -no-undefined $(all_libraries)
diff -U3 -r --new-file kdenetwork-3.3.2/kopete/protocols/msn/Makefile.in kdenetwork-3.3.2-new/kopete/protocols/msn/Makefile.in
--- kdenetwork-3.3.2/kopete/protocols/msn/Makefile.in	2004-11-29 17:24:54.000000000 +0200
+++ kdenetwork-3.3.2-new/kopete/protocols/msn/Makefile.in	2005-05-21 14:21:28.000000000 +0300
@@ -74,18 +74,15 @@
 	msnaddcontactpage.lo msncontact.lo msnsocket.lo \
 	msnmessagemanager.lo msndebugrawcmddlg.lo msnnotifysocket.lo \
 	msnswitchboardsocket.lo msnfiletransfersocket.lo \
-	msninvitation.lo msnp2p.lo sha1.lo
+	msninvitation.lo msnp2p.lo sha1.lo sslloginhandler.lo
 #>- libkopete_msn_shared_la_OBJECTS =  \
 #>- 	$(am_libkopete_msn_shared_la_OBJECTS)
-#>+ 8
-libkopete_msn_shared_la_final_OBJECTS = libkopete_msn_shared_la.all_cpp.lo 
-libkopete_msn_shared_la_nofinal_OBJECTS = msnprotocol.lo msnaccount.lo \
+#>+ 5
+libkopete_msn_shared_la_OBJECTS = msnprotocol.lo msnaccount.lo \
 	msnaddcontactpage.lo msncontact.lo msnsocket.lo \
 	msnmessagemanager.lo msndebugrawcmddlg.lo msnnotifysocket.lo \
 	msnswitchboardsocket.lo msnfiletransfersocket.lo \
-	msninvitation.lo msnp2p.lo sha1.lo
-@KDE_USE_FINAL_FALSE@libkopete_msn_shared_la_OBJECTS = $(libkopete_msn_shared_la_nofinal_OBJECTS)
-@KDE_USE_FINAL_TRUE@libkopete_msn_shared_la_OBJECTS = $(libkopete_msn_shared_la_final_OBJECTS)
+	msninvitation.lo msnp2p.lo sha1.lo sslloginhandler.lo
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
 am__depfiles_maybe = depfiles
@@ -428,6 +425,7 @@
 xdg_appsdir = @xdg_appsdir@
 xdg_directorydir = @xdg_directorydir@
 xdg_menudir = @xdg_menudir@
+KDE_OPTIONS = nofinal
 #>- METASOURCES = AUTO
 SUBDIRS = ui . icons config
 AM_CPPFLAGS = -I$(srcdir)/ui \
@@ -440,7 +438,8 @@
 CLEANFILES = dummy.cpp
 libkopete_msn_shared_la_SOURCES = msnprotocol.cpp msnaccount.cpp msnaddcontactpage.cpp msncontact.cpp \
 	msnsocket.cpp msnmessagemanager.cpp msndebugrawcmddlg.cpp \
-	msnnotifysocket.cpp msnswitchboardsocket.cpp msnfiletransfersocket.cpp msninvitation.cpp msnp2p.cpp sha1.cpp
+	msnnotifysocket.cpp msnswitchboardsocket.cpp msnfiletransfersocket.cpp msninvitation.cpp msnp2p.cpp sha1.cpp \
+	sslloginhandler.cpp
 
 libkopete_msn_shared_la_LIBADD = ./ui/libkopetemsnui.la ../../libkopete/libkopete.la $(LIB_KIO)
 #>- libkopete_msn_shared_la_LDFLAGS = -version-info 0:0:0 -no-undefined $(all_libraries)
@@ -588,6 +587,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msnsocket.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msnswitchboardsocket.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sslloginhandler.Plo@am__quote@
 
 .cpp.o:
 @am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -856,7 +856,7 @@
 #>- clean-am: clean-generic clean-kde_moduleLTLIBRARIES \
 #>- 	clean-libLTLIBRARIES clean-libtool mostlyclean-am
 #>+ 2
-clean-am: clean-metasources clean-closures clean-bcheck clean-final  clean-generic clean-kde_moduleLTLIBRARIES \
+clean-am: clean-metasources clean-closures clean-bcheck  clean-generic clean-kde_moduleLTLIBRARIES \
 	clean-libLTLIBRARIES clean-libtool mostlyclean-am
 
 distclean: distclean-recursive
@@ -986,6 +986,13 @@
 mocs: msnprotocol.moc
 
 #>+ 3
+sslloginhandler.moc: $(srcdir)/sslloginhandler.h
+	$(MOC) $(srcdir)/sslloginhandler.h -o sslloginhandler.moc
+
+#>+ 2
+mocs: sslloginhandler.moc
+
+#>+ 3
 msnaccount.moc: $(srcdir)/msnaccount.h
 	$(MOC) $(srcdir)/msnaccount.h -o msnaccount.moc
 
@@ -1000,18 +1007,18 @@
 mocs: msnsocket.moc
 
 #>+ 3
-msnnotifysocket.moc: $(srcdir)/msnnotifysocket.h
-	$(MOC) $(srcdir)/msnnotifysocket.h -o msnnotifysocket.moc
+msnswitchboardsocket.moc: $(srcdir)/msnswitchboardsocket.h
+	$(MOC) $(srcdir)/msnswitchboardsocket.h -o msnswitchboardsocket.moc
 
 #>+ 2
-mocs: msnnotifysocket.moc
+mocs: msnswitchboardsocket.moc
 
 #>+ 3
-msnswitchboardsocket.moc: $(srcdir)/msnswitchboardsocket.h
-	$(MOC) $(srcdir)/msnswitchboardsocket.h -o msnswitchboardsocket.moc
+msnnotifysocket.moc: $(srcdir)/msnnotifysocket.h
+	$(MOC) $(srcdir)/msnnotifysocket.h -o msnnotifysocket.moc
 
 #>+ 2
-mocs: msnswitchboardsocket.moc
+mocs: msnnotifysocket.moc
 
 #>+ 3
 msnp2p.moc: $(srcdir)/msnp2p.h
@@ -1038,10 +1045,10 @@
 
 #>+ 3
 clean-metasources:
-	-rm -f  msndebugrawcmddlg.moc msnmessagemanager.moc msnfiletransfersocket.moc msncontact.moc msnprotocol.moc msnaccount.moc msnsocket.moc msnnotifysocket.moc msnswitchboardsocket.moc msnp2p.moc msnaddcontactpage.moc
+	-rm -f  msndebugrawcmddlg.moc msnmessagemanager.moc msnfiletransfersocket.moc msncontact.moc msnprotocol.moc sslloginhandler.moc msnaccount.moc msnsocket.moc msnswitchboardsocket.moc msnnotifysocket.moc msnp2p.moc msnaddcontactpage.moc
 
 #>+ 2
-KDE_DIST=kopete_msn.desktop msncontact.h msnp2p.h msnmessagemanager.h msnchatui.rc Changelog msnsocket.h ReleaseNotes msndebugrawcmddlg.h msnaccount.h msnfiletransfersocket.h sha1.h msninvitation.h Makefile.in msnswitchboardsocket.h msnprotocol.h msnnotifysocket.h msnaddcontactpage.h Makefile.am 
+KDE_DIST=msndebugrawcmddlg.h kopete_msn.desktop msncontact.h msnaccount.h msnp2p.h msnfiletransfersocket.h sha1.h msnmessagemanager.h msnchatui.rc sslloginhandler.h msninvitation.h Makefile.in Changelog msnswitchboardsocket.h msnsocket.h msnprotocol.h msnnotifysocket.h ReleaseNotes msnaddcontactpage.h Makefile.am 
 
 #>+ 3
 clean-closures:
@@ -1088,37 +1095,21 @@
 	done
 
 
-#>+ 11
-libkopete_msn_shared_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/msnprotocol.cpp $(srcdir)/msnaccount.cpp $(srcdir)/msnaddcontactpage.cpp $(srcdir)/msncontact.cpp $(srcdir)/msnsocket.cpp $(srcdir)/msnmessagemanager.cpp $(srcdir)/msndebugrawcmddlg.cpp $(srcdir)/msnnotifysocket.cpp $(srcdir)/msnswitchboardsocket.cpp $(srcdir)/msnfiletransfersocket.cpp $(srcdir)/msninvitation.cpp $(srcdir)/msnp2p.cpp $(srcdir)/sha1.cpp  msndebugrawcmddlg.moc msncontact.moc msnfiletransfersocket.moc msnmessagemanager.moc msnprotocol.moc msnaccount.moc msnsocket.moc msnnotifysocket.moc msnswitchboardsocket.moc msnp2p.moc msnaddcontactpage.moc
-	@echo 'creating libkopete_msn_shared_la.all_cpp.cpp ...'; \
-	rm -f libkopete_msn_shared_la.all_cpp.files libkopete_msn_shared_la.all_cpp.final; \
-	echo "#define KDE_USE_FINAL 1" >> libkopete_msn_shared_la.all_cpp.final; \
-	for file in msnprotocol.cpp msnaccount.cpp msnaddcontactpage.cpp msncontact.cpp msnsocket.cpp msnmessagemanager.cpp msndebugrawcmddlg.cpp msnnotifysocket.cpp msnswitchboardsocket.cpp msnfiletransfersocket.cpp msninvitation.cpp msnp2p.cpp sha1.cpp ; do \
-	  echo "#include \"$$file\"" >> libkopete_msn_shared_la.all_cpp.files; \
-	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libkopete_msn_shared_la.all_cpp.final; \
-	done; \
-	cat libkopete_msn_shared_la.all_cpp.final libkopete_msn_shared_la.all_cpp.files > libkopete_msn_shared_la.all_cpp.cpp; \
-	rm -f libkopete_msn_shared_la.all_cpp.final libkopete_msn_shared_la.all_cpp.files
-
-#>+ 3
-clean-final:
-	-rm -f libkopete_msn_shared_la.all_cpp.cpp
-
 #>+ 3
 final:
-	$(MAKE) libkopete_msn_shared_la_OBJECTS="$(libkopete_msn_shared_la_final_OBJECTS)" all-am
+	$(MAKE) all-am
 
 #>+ 3
 final-install:
-	$(MAKE) libkopete_msn_shared_la_OBJECTS="$(libkopete_msn_shared_la_final_OBJECTS)" install-am
+	$(MAKE) install-am
 
 #>+ 3
 no-final:
-	$(MAKE) libkopete_msn_shared_la_OBJECTS="$(libkopete_msn_shared_la_nofinal_OBJECTS)" all-am
+	$(MAKE) all-am
 
 #>+ 3
 no-final-install:
-	$(MAKE) libkopete_msn_shared_la_OBJECTS="$(libkopete_msn_shared_la_nofinal_OBJECTS)" install-am
+	$(MAKE) install-am
 
 #>+ 3
 cvs-clean:
@@ -1128,7 +1119,7 @@
 kde-rpo-clean:
 	-rm -f *.rpo
 
-#>+ 25
+#>+ 27
 msnnotifysocket.lo: msnnotifysocket.moc 
 msnprotocol.lo: msnprotocol.moc 
 msncontact.o: msncontact.moc 
@@ -1139,17 +1130,19 @@
 msnmessagemanager.lo: msnmessagemanager.moc 
 msndebugrawcmddlg.o: msndebugrawcmddlg.moc 
 msnsocket.lo: msnsocket.moc 
+sslloginhandler.lo: sslloginhandler.moc 
 msndebugrawcmddlg.lo: msndebugrawcmddlg.moc 
 msncontact.lo: msncontact.moc 
 nmcheck: 
 msnaddcontactpage.o: msnaddcontactpage.moc 
-msnsocket.o: msnsocket.moc 
 msnnotifysocket.o: msnnotifysocket.moc 
+msnsocket.o: msnsocket.moc 
 nmcheck-am: nmcheck
 msnswitchboardsocket.lo: msnswitchboardsocket.moc 
+sslloginhandler.o: sslloginhandler.moc 
 msnprotocol.o: msnprotocol.moc 
-msnmessagemanager.o: msnmessagemanager.moc 
 msnswitchboardsocket.o: msnswitchboardsocket.moc 
+msnmessagemanager.o: msnmessagemanager.moc 
 msnaddcontactpage.lo: msnaddcontactpage.moc 
 msnp2p.o: msnp2p.moc 
 msnfiletransfersocket.lo: msnfiletransfersocket.moc 
diff -U3 -r --new-file kdenetwork-3.3.2/kopete/protocols/msn/msnnotifysocket.cpp kdenetwork-3.3.2-new/kopete/protocols/msn/msnnotifysocket.cpp
--- kdenetwork-3.3.2/kopete/protocols/msn/msnnotifysocket.cpp	2004-08-05 22:26:24.000000000 +0300
+++ kdenetwork-3.3.2-new/kopete/protocols/msn/msnnotifysocket.cpp	2005-05-19 23:40:15.000000000 +0300
@@ -23,6 +23,7 @@
 #include "msnnotifysocket.h"
 #include "msncontact.h"
 #include "msnaccount.h"
+#include "sslloginhandler.h"
 
 #include <qregexp.h>
 
@@ -47,7 +48,8 @@
 : MSNSocket( account )
 {
 	m_newstatus = MSNProtocol::protocol()->NLN;
-	
+	m_sslLoginHandler=0l;
+
 	m_isHotmailAccount=false;
 	m_ping=false;
 
@@ -66,7 +68,7 @@
 
 MSNNotifySocket::~MSNNotifySocket()
 {
-	delete m_tmpMailFile;
+	delete m_sslLoginHandler;
 	kdDebug(14140) << k_funcinfo << endl;
 }
 
@@ -246,7 +248,7 @@
 	
 	if ( cmd == "VER" )
 	{
-		sendCommand( "CVR", "0x0409 winnt 5.1 i386 MSNMSGR 6.0.0602 MSMSGS " + m_account->accountId() );
+		sendCommand( "CVR", "0x0409 winnt 5.1 i386 MSNMSGR 6.2.0205 MSMSGS " + m_account->accountId() );
 /*
 		struct utsname utsBuf;
 		uname ( &utsBuf );
@@ -264,26 +266,15 @@
 	{
 		if( data.section( ' ', 1, 1 ) == "S" )
 		{
-			m_authData=data.section( ' ' , 2 , 2 );
-			m_kv=QString::null;
+			m_sslLoginHandler = new SslLoginHandler();
+			QObject::connect( m_sslLoginHandler, SIGNAL(       loginFailed()        ),
+					 this,            SLOT  (    sslLoginFailed()        ) );
+			QObject::connect( m_sslLoginHandler, SIGNAL(    loginIncorrect()        ),
+					 this,            SLOT  ( sslLoginIncorrect()        ) );
+			QObject::connect( m_sslLoginHandler, SIGNAL(    loginSucceeded(QString) ),
+					 this,            SLOT  ( sslLoginSucceeded(QString) ) );
 
-			if( m_account->accountId().contains("@hotmail.com") )
-				m_sid="loginnet.passport.com";
-			else if( m_account->accountId().contains("@msn.com") ||  m_account->accountId().contains("@compaq.net") ||  m_account->accountId().contains("@webtv.net") )
-				m_sid="msnialogin.passport.com";
-			else
-				m_sid="login.passport.com";
-
-			QString authURL="https://"+m_sid+"/login.srf?" + m_authData;
-			authURL.replace("," , "&" ) ;
-
-			kdDebug(14140) << k_funcinfo << "downlaod URL: " << authURL << endl;
-
-			KIO::Job *job = KIO::get( KURL( authURL ), true, false );
-			job->addMetaData("cookies", "manual");
-			// This should force kio to download the page even is we are in the konqueror offline mode.  [see bug #68483]
-			job->addMetaData("cache", "reload");
-			QObject::connect( job, SIGNAL(result( KIO::Job *)), this, SLOT(slotAuthJobDone( KIO::Job *)) );
+			m_sslLoginHandler->login( data.section( ' ' , 2 , 2 ), m_account->accountId() , m_password );
 		}
 		else
 		{
@@ -570,76 +561,20 @@
 }
 
 
-void MSNNotifySocket::slotAuthJobDataReceived ( KIO::Job */*job*/,const  QByteArray &data)
+void MSNNotifySocket::sslLoginFailed()
 {
-	m_authData += QCString( data, data.size()+1 );
-//	kdDebug(14140) << "MSNNotifySocket::slotAuthJobDataReceived: " << data << endl;
+	disconnect();
 }
-
-void MSNNotifySocket::slotAuthJobDone ( KIO::Job *job)
+void MSNNotifySocket::sslLoginIncorrect()
 {
-//	kdDebug(14140) << "MSNNotifySocket::slotAuthJobDone: "<< m_authData << endl;
-
-	if(job->error())
-	{
-		//FIXME: Shouldn't we say that we are the MSN plugin?
-		job->showErrorDialog();
-		disconnect();
-		return;
-	}
-
-	if(m_kv.isNull())
-	{
-		QStringList cookielist=QStringList::split("\n", job->queryMetaData("setcookies") );
-		QString cookies="Cookie: ";
-		for ( QStringList::Iterator it = cookielist.begin(); it != cookielist.end(); ++it )
-		{
-			QRegExp rx("Set-Cookie: ([^;]*)");
-			rx.search(*it);
-			cookies+=rx.cap(1)+";";
-		}
-
-		//QRegExp rx("lc=([1-9]*),id=([1-9]*),tw=([1-9]*),fs=[1-9]*,ru=[1-9a-zA-Z%]*,ct=[1-9]*,kpp=[1-9]*,kv=([1-9]*),");
-		QRegExp rx("lc=([0-9]*),id=([0-9]*),tw=([0-9]*),.*kv=([0-9]*),");
-		rx.search(m_authData);
-
-		QString authURL = "https://" + m_sid + "/ppsecure/post.srf?lc=" + rx.cap( 1 ) + "&id=" +
-			rx.cap( 2 ) + "&tw=" + rx.cap( 3 ) + "&cbid=" + rx.cap( 2 ) + "&da=passport.com&login=" +
-			KURL::encode_string( m_account->accountId()) + "&domain=passport.com&passwd=";
-
-		kdDebug( 14140 ) << k_funcinfo << "Download URL: " << authURL << "(*******)" << endl;
-
-		m_authData = QString::null;
-		m_kv=rx.cap(4);
-		if(m_kv.isNull()) m_kv="";
-
-		authURL += KURL::encode_string( m_password ) ;
-		job = KIO::get( KURL( authURL ), false, false );
-		job->addMetaData("cookies", "manual");
-		job->addMetaData("setcookies", cookies);
-		job->addMetaData("cache", "reload");
-
-		QObject::connect( job, SIGNAL(data( KIO::Job *,const QByteArray&)), this, SLOT(slotAuthJobDataReceived( KIO::Job *,const QByteArray&)) );
-		QObject::connect( job, SIGNAL(result( KIO::Job *)), this, SLOT(slotAuthJobDone( KIO::Job *)) );
-	}
-	else
-	{
-		if(m_authData.contains("CookiesDisabled"))
-		{
-			// FIXME: is this still possible now we add our meta data? - Martijn
-			disconnect();
-			KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error,
-				i18n( "Unable to connect to the MSN Network.\nYour Web browser options are currently set to disable cookies.\n"
-				"To use .NET Passport, you must enable cookies at least for the passport.com domain" ), i18n( "MSN Plugin" ) );
-			return;
-		}
-
-		QRegExp rx(/*URL=http://memberservices.passport.net/memberservice.srf*/"\\?did=[0-9]*&(t=[0-9A-Za-z!$*]*&p=[0-9A-Za-z!$*]*)\"");
-		rx.search(m_authData);
-
-		m_badPassword=true;  //if this disconnect, that mean the password was bad
-		sendCommand("USR" , "TWN S " + rx.cap(1));
-	}
+	m_badPassword = true;
+	disconnect();
+}
+void MSNNotifySocket::sslLoginSucceeded(QString a)
+{
+	sendCommand("USR" , "TWN S " + a);
+	m_sslLoginHandler->deleteLater();
+	m_sslLoginHandler=0;
 }
 
 
diff -U3 -r --new-file kdenetwork-3.3.2/kopete/protocols/msn/msnnotifysocket.h kdenetwork-3.3.2-new/kopete/protocols/msn/msnnotifysocket.h
--- kdenetwork-3.3.2/kopete/protocols/msn/msnnotifysocket.h	2004-06-25 12:10:14.000000000 +0300
+++ kdenetwork-3.3.2-new/kopete/protocols/msn/msnnotifysocket.h	2005-05-19 23:37:35.000000000 +0300
@@ -29,6 +29,7 @@
 class MSNDispatchSocket;
 class MSNAccount;
 class KTempFile;
+class SslLoginHandler;
 
 #include <kio/job.h>
 
@@ -138,8 +139,9 @@
 
 
 
-	void slotAuthJobDataReceived ( KIO::Job *, const QByteArray &data);
-	void slotAuthJobDone ( KIO::Job *);
+	void sslLoginFailed();
+	void sslLoginIncorrect();
+	void sslLoginSucceeded(QString);
 
 
 private:
@@ -171,7 +173,7 @@
 	QString m_kv;
 	QString m_sid;
 	QString m_loginTime;
-	QString m_authData;
+	SslLoginHandler *m_sslLoginHandler;
 
 	QTimer *m_keepaliveTimer;
 
diff -U3 -r --new-file kdenetwork-3.3.2/kopete/protocols/msn/msnsocket.cpp kdenetwork-3.3.2-new/kopete/protocols/msn/msnsocket.cpp
--- kdenetwork-3.3.2/kopete/protocols/msn/msnsocket.cpp	2004-10-03 10:43:34.000000000 +0300
+++ kdenetwork-3.3.2-new/kopete/protocols/msn/msnsocket.cpp	2005-05-19 23:41:29.000000000 +0300
@@ -133,7 +133,7 @@
 
 void MSNSocket::slotSocketError( int error )
 {
-	kdDebug( 14140 ) << k_funcinfo << "Error: " << error << endl;
+	kdWarning( 14140 ) << k_funcinfo << "Error: " << error << " (" << m_socket->errorString() << ")" << endl;
 
 	QString errormsg = i18n( "There was an error while connecting to the MSN server.\nError message:\n" );
 	if ( error == KSocketBase::LookupFailure )
diff -U3 -r --new-file kdenetwork-3.3.2/kopete/protocols/msn/sslloginhandler.cpp kdenetwork-3.3.2-new/kopete/protocols/msn/sslloginhandler.cpp
--- kdenetwork-3.3.2/kopete/protocols/msn/sslloginhandler.cpp	1970-01-01 03:00:00.000000000 +0300
+++ kdenetwork-3.3.2-new/kopete/protocols/msn/sslloginhandler.cpp	2005-05-19 18:10:06.000000000 +0300
@@ -0,0 +1,453 @@
+//Imported from KMess (2005-05-19)
+
+/***************************************************************************
+                          sslloginhandler.cpp  -  description
+                             -------------------
+    begin                : Sat Jun 28 2003
+    copyright            : (C) 2003 by Mike K. Bennett
+    email                : mkb137b@hotmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "sslloginhandler.h"
+
+#include <qstringlist.h>
+#include <qregexp.h>
+#include <qsocket.h>
+#include <qurl.h>
+
+#include <kdebug.h>
+#include <kextsock.h>
+#include <kssl.h>
+#include <kurl.h>
+
+#if 0
+#include "../kmessdebug.h"
+#include "mimemessage.h"
+#else
+//i didn't want to import the whole MimeMessage from Kmess for Kopete so i
+// reimplemented the base here  -Olivier
+
+class MimeMessage
+{
+	public:
+		MimeMessage(const QString &msg) : message(msg) {}
+
+		QString getValue(const QString &key)
+		{
+			QRegExp rx(key+": (.*)\n");
+			rx.search(message);
+			return rx.cap(1);
+		}
+	private:
+		QString message;
+};
+
+#include "sslloginhandler.moc"
+#endif
+//there is nothing modified from here.  this is exactly the kmerlin code
+
+
+
+/*
+ * Great documentation about this can be found at
+ * http://siebe.bot2k3.net/docs/
+ */
+
+
+// The constructor
+SslLoginHandler::SslLoginHandler()
+ : mode_(NONE)
+{
+  // Create the SSL handler
+  ssl_ = new KSSL( true );
+
+  // Create and set up the socket.
+  socket_ = new KExtendedSocket( );
+
+  //socket_->setSocketFlags( 0x00 | 0x600000 ); // 0x00 = anySocket | 0x600000 = bufferedSocket
+  socket_->setSocketFlags( 0x00 ); // 0x00 = anySocket | 0x600000 = bufferedSocket
+  socket_->setTimeout( 30   );
+  socket_->enableRead( true );
+  connect( socket_, SIGNAL(         readyRead()    ),
+           this,    SLOT  (      dataReceived()    ) );
+  connect( socket_, SIGNAL(  connectionFailed(int) ),
+           this,    SLOT  (       socketError(int) ) );
+}
+
+
+
+// The destructor
+SslLoginHandler::~SslLoginHandler()
+{
+  delete ssl_;
+  delete socket_;
+}
+
+
+
+// Data was received over the socket
+void SslLoginHandler::dataReceived()
+{
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - ******************** Data received ********************" << endl;
+  kdDebug() << "SslLoginHandler - " << socket_->bytesAvailable() << " bytes available." << endl;
+  kdDebug() << "SslLoginHandler - SSL says " << ssl_->pending() << " bytes available." << endl;
+#endif
+
+  QString   data;
+  int       breakOut = 0;
+  const int maxIterations = 1000;
+  while ( ( !data.contains( QRegExp("\r\n") ) ) && ( breakOut < maxIterations ) )
+  {
+    // Read data via SSL
+    data = readSslData();
+    breakOut ++;
+  }
+
+  // Output the data for debugging
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - ********************   Contents    ********************" << endl;
+  kdDebug() << data << endl;
+  kdDebug() << "SslLoginHandler - ********************  End of data  ********************" << endl;
+#endif
+
+  // Warn if timed out
+  if ( breakOut >= maxIterations )
+  {
+    kdDebug() << "WARNING - SSL read timed out." << endl;
+    emit loginFailed();
+    return;
+  }
+
+  if ( data.length() > 0 )
+  {
+    parseHttpResponse(data);
+  }
+  else
+  {
+    kdDebug() << "WARNING - Available data wasn't read from the SSL socket." << endl;
+    emit loginFailed();
+  }
+}
+
+
+
+// Start the login process
+void SslLoginHandler::login( QString parameters, QString handle, QString password )
+{
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - Starting login with parameters " << parameters << "." << endl;
+#endif
+
+  // Store the given data
+  authenticationParameters_ = parameters;
+  handle_                   = handle;
+  password_                 = password;
+
+  // Get the login server
+  sendLoginServerRequest("nexus.passport.com");
+  dataReceived();
+}
+
+
+
+// Get the authentication data from a string
+void SslLoginHandler::parseAuthenticationData( QString data )
+{
+  QString twnData;
+
+  // Pull TWN data out of the message
+  twnData = data.right( data.length() - data.find(QRegExp("from-PP='")) - 9 );
+  twnData = twnData.left( twnData.find(QRegExp("',")) );
+
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - data for TWN is " << twnData << "." << endl;
+#endif
+
+  // Notify the MsnNotificationConnection
+  emit loginSucceeded(twnData);
+}
+
+
+
+// Parse the HTTP response from the server
+void SslLoginHandler::parseHttpResponse(QString data)
+{
+  KURL    location;
+  int     headerEnd;
+  QString header;
+  int     headerCode;
+  QString headerText;
+
+  // Parse the HTTP status header
+  QRegExp re("HTTP/\\d+\\.\\d+ (\\d+) ([^\r\n]+)");
+  headerEnd  = data.find("\r\n");
+  header     = data.left( (headerEnd == -1) ? 20 : headerEnd );
+
+  re.search(header);
+  headerCode = re.cap(1).toUInt();
+  headerText = re.cap(2);
+
+  // Create a MimeMessage, removing the HTTP status header
+  MimeMessage message( data.section( ",", 1 ) );
+
+
+  switch(mode_)
+  {
+    case GETLOGINSERVER:
+    {
+      // Step 1. This data describes the login server to use.
+      if(headerCode == 302)
+      {
+        // HTTP Redirect
+        location = KURL( message.getValue( "Location" ) );
+        sendLoginServerRequest(location.host());
+      }
+      else
+      {
+        // Parse the data
+        QString loginServer;
+        QString page;
+        parseLoginServerData( loginServer, page, message.getValue("PassportURLs") );
+
+        // Send the authentication request
+        sendAuthenticationRequest( loginServer, page );
+      }
+      break;
+    }
+    case GETAUTHENTICATIONDATA:
+    {
+      // Step 2. Get the authentication data
+      if(headerCode == 200)
+      {
+        // Login success
+        parseAuthenticationData(message.getValue("Authentication-Info"));
+      }
+      else if(headerCode == 302)
+      {
+        // HTTP Redirect
+        location = KURL( message.getValue( "Location" ) );
+        sendAuthenticationRequest(location.host(), location.path());
+      }
+      else if(headerCode == 401)
+      {
+        // Got a HTTP "401 Unauthorized"; Login failed
+        emit loginIncorrect();
+      }
+      else
+      {
+        kdDebug() << "SslLoginHandler::parseHttpResponse: WARNING "
+                  << "- Unhandled response code " << headerCode << " " << headerText << endl;
+        emit loginFailed();
+      }
+      break;
+    }
+    default:
+    {
+      kdDebug() << "SslLoginHandler::parseHttpResponse: WARNING - Entered illegal state" << endl;
+      emit loginFailed();
+    }
+  }
+}
+
+
+// Get login server data from a string
+void SslLoginHandler::parseLoginServerData( QString &host, QString &page, QString serverData )
+{
+  int slashIndex;
+
+  // Get everything between "DLLogin=" and to the comma.
+  serverData = serverData.right( serverData.length() - serverData.find( "DALogin=" ) - 8 );
+  serverData = serverData.left( serverData.find( "," ) );
+
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - host/page=" << serverData << endl;
+#endif
+
+  // Separate the "host/page" string.
+  slashIndex = serverData.find( "/" );
+  host = serverData.left( slashIndex );
+  page = serverData.right( serverData.length() - slashIndex );
+
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - host=" << host << " page=" << page << endl;
+#endif
+}
+
+
+
+// Read data from the socket via SSL
+QString SslLoginHandler::readSslData()
+{
+  char       rawblock[1024];
+  QCString   block;
+  QString    data        = "";
+  int        noBytesRead = 1;
+
+  // Read data from the SSL socket.
+  if ( ssl_ != 0 )
+  {
+//    while( ( ssl_->pending() > 0 ) && ( noBytesRead > 0 ) )
+//    while( ( socket_->bytesAvailable() > 0 ) && ( noBytesRead > 0 ) )
+    while(noBytesRead > 0)
+    {
+      noBytesRead = ssl_->read( rawblock, 1024 );
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+      kdDebug() << "SslLoginHandler - " << noBytesRead << " bytes read." << endl;
+#endif
+      block = rawblock;
+      block = block.left( noBytesRead );
+      data += QString::fromUtf8( block );
+    }
+  }
+
+  return data;
+}
+
+
+
+// Send the authenticationn request
+void SslLoginHandler::sendAuthenticationRequest( QString loginServer, QString page )
+{
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - Step 2. Requesting authentication data." << endl;
+#endif
+
+  QString request;
+  QString encodedHandle   = handle_;
+  QString encodedPassword = password_;
+
+  QUrl::encode(encodedHandle);
+  QUrl::encode(encodedPassword);
+
+  request = "GET " + page + " HTTP/1.1\r\n"
+            "Authorization: Passport1.4"
+              " OrgVerb=GET"
+              ",OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom"
+              ",sign-in=" + encodedHandle +
+              ",pwd="     + encodedPassword +
+              ","         + authenticationParameters_ + "\r\n"
+            "User-Agent: MSMSGS\r\n"     // Make sure the server won't discriminate
+            "Host: " + loginServer + "\r\n"
+            "Connection: Keep-Alive\r\n"
+            "Cache-Control: no-cache\r\n\r\n";
+
+  // Step 2. Send the authorisation request
+  mode_ = GETAUTHENTICATIONDATA;
+  sendHttpRequest( request, loginServer, 443 );
+}
+
+
+
+// Send a HTTP request to the server
+void SslLoginHandler::sendHttpRequest( QString request, QString host, int port )
+{
+  QString response;
+  QString responseBody;
+
+  if ( socket_ == 0 )
+  {
+    kdDebug() << "SslLoginHandler::sendHttpRequest - WARNING "
+              << "- Trying to login using a null socket." << endl;
+    return;
+  }
+
+  // Configure the socket
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - Close and reset the socket." << endl;
+#endif
+  ssl_->setAutoReconfig( true );
+  ssl_->reInitialize();
+  socket_->closeNow();
+  socket_->reset();
+
+  // Try to connect
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - Connecting to " << host << ":" << port << "." << endl;
+#endif
+  socket_->setAddress( host, port );
+  socket_->lookup();
+  int connectionSuccess = socket_->connect();
+  if ( connectionSuccess != 0 )
+  {
+    kdDebug() << "SslLoginHandler::sendHttpRequest - WARNING "
+              << "- Connection failed, giving " << connectionSuccess << endl;
+    return;
+  }
+
+  // Try to wrap the SSL handler
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - Connection success, binding SSL to socket fd " << socket_->fd() << endl;
+#endif
+  int sslConnectionSuccess = ssl_->connect( socket_->fd() );
+  if ( sslConnectionSuccess != 1 )
+  {
+    kdDebug() << "SslLoginHandler::sendHttpRequest - WARNING "
+              << "- SSL Connection failed, giving " << sslConnectionSuccess << endl;
+    return;
+  }
+
+  // Send the request
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - SSL connected OK, sending the request." << endl;
+  kdDebug() << request;
+#endif
+  writeSslData( request );
+}
+
+
+
+// Request the name of the login server
+void SslLoginHandler::sendLoginServerRequest(QString hostname)
+{
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+  kdDebug() << "SslLoginHandler - Step 1. Requesting the login server." << endl;
+#endif
+
+  // Step 1. Send the login server request
+  // The server will respond with the location of the main SSL server.
+  mode_ = GETLOGINSERVER;
+  sendHttpRequest( "GET /rdr/pprdr.asp\r\n\r\n", hostname, 443 );
+}
+
+
+
+// Detect a socket error
+void SslLoginHandler::socketError(int error)
+{
+  kdDebug() << "SslLoginHandler : WARNING - Received error " << error << " from the socket." << endl;
+}
+
+
+
+// Write data to the socket via SSL
+void SslLoginHandler::writeSslData( QString data )
+{
+  int noBytesWritten;
+
+  if(socket_ != 0 && ssl_ != 0)
+  {
+    noBytesWritten = ssl_->write( data.latin1(), data.length() );
+    if(noBytesWritten != (int)data.length())
+    {
+      kdDebug() << "WARNING - Wanted to write " << data.length() << " to the socket, "
+                << " wrote " << noBytesWritten << "." << endl;
+    }
+#ifdef KMESSDEBUG_SSLLOGINHANDLER
+    else
+    {
+      kdDebug() << "SslLoginHandler - Sent " << noBytesWritten << " bytes via SSL." << endl;
+    }
+#endif
+  }
+}
+
diff -U3 -r --new-file kdenetwork-3.3.2/kopete/protocols/msn/sslloginhandler.h kdenetwork-3.3.2-new/kopete/protocols/msn/sslloginhandler.h
--- kdenetwork-3.3.2/kopete/protocols/msn/sslloginhandler.h	1970-01-01 03:00:00.000000000 +0300
+++ kdenetwork-3.3.2-new/kopete/protocols/msn/sslloginhandler.h	2005-05-19 18:10:06.000000000 +0300
@@ -0,0 +1,96 @@
+//Imported from KMess  - 2005-05-19
+
+/***************************************************************************
+                          sslloginhandler.h  -  description
+                             -------------------
+    begin                : Sat Jun 28 2003
+    copyright            : (C) 2003 by Mike K. Bennett
+    email                : mkb137b@hotmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef SSLLOGINHANDLER_H
+#define SSLLOGINHANDLER_H
+
+#include <qobject.h>
+#include <qstringlist.h>
+
+// Forward declarations
+class KExtendedSocket;
+class KSSL;
+class MimeMessage;
+
+/**This class handles the SSL portion of the login.
+  *@author Mike K. Bennett
+  */
+
+class SslLoginHandler : public QObject
+{
+   Q_OBJECT
+
+  public:
+    // The constructor
+                         SslLoginHandler();
+    // The destructor
+                        ~SslLoginHandler();
+    // Start the login process
+    void                 login( QString parameters, QString handle, QString password );
+
+  private : // Private methods
+    // Get the authentication data from a string
+    void                 parseAuthenticationData( QString data );
+    // Parse the HTTP response from the server
+    void                 parseHttpResponse(QString data);
+    // Get login server data from a string
+    void                 parseLoginServerData( QString &host, QString &page, QString serverData );
+    // Read data from the socket via SSL
+    QString              readSslData();
+    // Send the authenticationn request
+    void                 sendAuthenticationRequest( QString loginServer, QString page );
+    // Send a HTTP request to the server
+    void                 sendHttpRequest( QString request, QString host, int port );
+    // Request the name of the login server
+    void                 sendLoginServerRequest(QString hostname);
+    // Write data to the socket via SSL
+    void                 writeSslData( QString data );
+
+  private slots : // Private slots
+    // Data was received over the socket
+    void                 dataReceived();
+    // Detect a socket error
+    void                 socketError(int error);
+
+  private : // Private attributes
+    // The mode of the transfer.
+    enum Mode          { NONE = 0, GETLOGINSERVER = 1, GETAUTHENTICATIONDATA = 2 } mode_;
+    // The list of parameters sent by the notification server
+    QString              authenticationParameters_;
+    // The cookies we received from the server
+    QStringList          cookies_;
+    // The user's handle
+    QString              handle_;
+    // The user's password
+    QString              password_;
+    // The socket over which the SSL data is written and read
+    KExtendedSocket     *socket_;
+    // The SSL handler
+    KSSL                *ssl_;
+
+  signals : // Public signals
+    // Signal that the login was aborted because an internal error occured
+    void                 loginFailed();
+    // Signal that the login failed, username/password was incorrect
+    void                 loginIncorrect();
+    // Signal that the login succeeded
+    void                 loginSucceeded( QString authentication );
+};
+
+#endif