Re: CenterICQ/CenterIM suggestion - disable ICQ auth requests & ASCII hierarchy

Mark Pustjens <[email protected]> Fri, 2 Mar 2007 20:51:29 +0100 (CET)
Newsgroups gmane.network.centericq
Message-ID <[email protected]>
On Thu, 1 Mar 2007, laurent richer wrote:

> Hi all,
>
> Something i've been thinking about lately would be to disable ICQ
> authorization requests.
>

Me too!

> I'm not sure if this would break protocol or not, but i think this can be
> done by acknowledging the request to the server and then silently dropping
> the request without ever displaying it to the user.
>

Why reject if you can ignore? No use letting the spammer know we're alive 
:)

> I've been a user of centericq for 4-5 years now, and over that time i must
> have received thousands, if not hundreds of thousands of auth requests, a
> handful every single day - none of which were legitimate. If someone i
> actually want to talk to on ICQ wants to add me to their list, then they
> already know how to contact me and i can add them to my list first.
>
> This is not a problem with Centericq, this is a problem with the ICQ
> network, but i still prefer ICQ over others and still use it every day.
>
> Perhaps this can be done with a ./configure parameter or in the main
> configuration options area.
>

A configuration option is better

>
> I would also like to revisit the possibility of removing the ASCII hierarchy
> from the contact list. If removed, this would free up 6 characters of space
> to be put to better use. Also, if combined with the previous request of a
> resizable contact/chat pane, this would leave a lot more room for chat
> buffer.
>
>
> something to think about.

Been there, done that, and all i got was this stupid patch :)
(see attachment, also includes the panel resizing, which appearantly was 
not yet in mob)

>
> kind regards,
> Laurent
>

As a sidenote: can someone explain how to commit to the mob?
I did a cg commit, but it thinks *all* files should be committed (all 
marked as `modified', but they are not)

Thanks

-- 
There was a crash from the direction of the kitchen, although it was more of a
crescendo - the long-drawn-out clatter that begins when a pile of plates begins
to slip, continues when someone tries to grab at them, develops a desperate
counter-theme when the person realizes they don't have three hands, and ends
with the roinroinroin of the one miraculously intact plate spinning round and
round on the floor.
   (Maskerade)

_______________________________________________
Cicq mailing list
Cicq-xGejAJT2w6wWP6gT/[email protected]
http://mailman.linuxpl.org/mailman/listinfo/cicq
Questions? Check the FAQ first: http://centericq.de/faq/
centerim-02-03-2007-icqdropauthreq.patch (text/plain, 11.3 KB)
diff -Naur centerim.mob/src/eventmanager.cc centerim.icqdropauthreq/src/eventmanager.cc
--- centerim.mob/src/eventmanager.cc	2007-03-02 20:28:31.000000000 +0100
+++ centerim.icqdropauthreq/src/eventmanager.cc	2007-03-02 20:12:22.000000000 +0100
@@ -64,8 +64,11 @@
 	    c = clist.get(ev.getcontact());
 
 	    if(!c) {
-		proceed = !conf.getantispam();
-		proceed = (ev.gettype() == imevent::authorization) || proceed;
+		proceed = !conf.getantispam() || 
+			((ev.gettype() == imevent::authorization) && !conf.geticqdropauthreq());
+
+		if ((ev.gettype() == imevent::authorization) && !conf.geticqdropauthreq())
+		    face.log("Dropped another authorization request!");
 
 		if(proceed)
 		    c = clist.addnew(ev.getcontact());
diff -Naur centerim.mob/src/icqconf.h centerim.icqdropauthreq/src/icqconf.h
--- centerim.mob/src/icqconf.h	2007-03-02 20:28:31.000000000 +0100
+++ centerim.icqdropauthreq/src/icqconf.h	2007-03-02 20:13:44.000000000 +0100
@@ -85,7 +85,13 @@
     key_show_urls,
     key_rss_check,
     key_multiple_recipients,
-    key_user_external_action
+    key_user_external_action,
+    key_left_panel_move_right,
+    key_left_panel_move_left,
+    key_log_panel_move_up,
+    key_log_panel_move_down,
+    key_chat_panel_move_up,
+    key_chat_panel_move_down
 };
 
 class icqconf {
@@ -135,7 +141,7 @@
 
 	int autoaway, autona, ptpmin, ptpmax;
 
-	bool hideoffline, quote, savepwd, antispam, mailcheck,
+	bool hideoffline, quote, savepwd, antispam, icqdropauthreq, mailcheck,
 	    makelog, fenoughdiskspace, askaway, bidi, logtimestamps,
 	    logonline, emacs, proxyconnect, proxyssl, notitles, debug,
 	    timestampstothesecond;
@@ -162,6 +168,9 @@
 	regcolor rc;
 	groupmode fgroupmode;
 	colormode cm;
+	int leftpanelwidth;
+	int logpanelheight;
+	int chatpanelheight;
 
 	colorschemer<cicq_colorpairs> schemer;
 
@@ -215,6 +224,9 @@
 	bool getantispam() const { return antispam; }
 	void setantispam(bool fas);
 
+	bool geticqdropauthreq() const { return icqdropauthreq; }
+	void seticqdropauthreq(bool fas);
+
 	bool getmailcheck() const { return mailcheck; }
 	void setmailcheck(bool fmc);
 
@@ -325,6 +337,13 @@
 
 	bool getxtitles() const { return !notitles; }
 	bool getdebug() const { return debug; }
+	
+	int  getleftpanelwidth() const { return leftpanelwidth; }
+	void setleftpanelwidth(const int width)   { leftpanelwidth  = width; }
+	int  getlogpanelheight() const { return logpanelheight; }
+	void setlogpanelheight(const int height) { logpanelheight = height; }
+	int  getchatpanelheight() const { return chatpanelheight; }
+	void setchatpanelheight(const int height) { chatpanelheight = height; }
 };
 
 extern icqconf conf;
diff -Naur centerim.mob/src/icqdialogs.cc centerim.icqdropauthreq/src/icqdialogs.cc
--- centerim.mob/src/icqdialogs.cc	2007-03-02 20:28:31.000000000 +0100
+++ centerim.icqdropauthreq/src/icqdialogs.cc	2007-03-02 20:13:21.000000000 +0100
@@ -1087,6 +1087,7 @@
 bool icqface::updateconf(icqconf::regsound &s, icqconf::regcolor &c) {
     bool finished, success, hasany;
     int nopt, n, i, b, nconf, ncomm, aaway, ana, noth, nfeat, ncl;
+    bool needredraw = false;
     protocolname pname;
     string tmp, phidden;
 
@@ -1097,6 +1098,7 @@
     bool savepwd = conf.getsavepwd();
     bool hideoffl = conf.gethideoffline();
     bool antispam = conf.getantispam();
+    bool icqdropauthreq = conf.geticqdropauthreq();
     bool mailcheck = conf.getmailcheck();
     bool makelog = conf.getmakelog();
     bool askaway = conf.getaskaway();
@@ -1179,6 +1181,9 @@
 	i = t.addnode(_(" User interface "));
 	t.addleaff(i, 0, 1, _(" Change sound device to : %s "), strregsound(s));
 	t.addleaff(i, 0, 2, _(" Change color scheme to : %s "), strregcolor(c));
+	t.addleaff(i, 0, 31, _(" Left panel width :  %d "), conf.getleftpanelwidth());
+	t.addleaff(i, 0, 32, _(" Log panel height :  %d "), conf.getlogpanelheight());
+	t.addleaff(i, 0, 33, _(" Chat panel height : %d "), conf.getchatpanelheight());
 
     #ifdef USE_FRIBIDI
 	t.addleaff(i, 0, 20, _( " Enable bidirectional languages support : %s "), stryesno(bidi));
@@ -1204,6 +1209,7 @@
 	t.addleaff(i, 0, 17, _(" Arrange contacts into groups : %s "), strgroupmode(gmode));
 	t.addleaff(i, 0,  6, _(" Hide offline users : %s "), stryesno(hideoffl));
 	t.addleaff(i, 0, 14, _(" Anti-spam: kill msgs from users not on the list : %s "), stryesno(antispam));
+	t.addleaff(i, 0, 49, _(" Anti-spam: drop icq authorization requests: %s "), stryesno(icqdropauthreq));
 	t.addleaff(i, 0,  8, _(" Quote a message on reply : %s "), stryesno(quote));
 	t.addleaff(i, 0, 15, _(" Check the local mailbox : %s "), stryesno(mailcheck));
 	t.addleaff(i, 0, 13, _(" Remember passwords : %s "), stryesno(savepwd));
@@ -1380,12 +1386,30 @@
 			break;
 		    case 30:
 			cm = (cm == icqconf::cmproto ? icqconf::cmstatus : icqconf::cmproto );
+			break;
 		    case 31:
 		        tmp = inputstr(_("HTTP browser to use: "), browser);
 			if(!tmp.empty()) browser = browser;
 		        break;
+		    case 32:    
+			conf.setleftpanelwidth(atol(inputstr(_("Left panel width: "), 
+			    strint(conf.getleftpanelwidth())).c_str()));
+			needredraw = true;
+			break;
+		    case 33:
+			conf.setlogpanelheight(atol(inputstr(_("Log panel height: "), 
+			    strint(conf.getlogpanelheight())).c_str()));
+			needredraw = true;
+			break;  
+		    case 34:
+			conf.setchatpanelheight(atol(inputstr(_("Chat panel height: "), 
+			    strint(conf.getchatpanelheight())).c_str()));
+			needredraw = true;
+			break;
+
  		    case 48:
 		        timestampstothesecond = !timestampstothesecond; break;
+		    case 49: icqdropauthreq = !icqdropauthreq; break;
   		}
   		break;
 	    case 1:
@@ -1396,6 +1420,7 @@
 		conf.sethideoffline(hideoffl);
 		conf.setemacs(emacs);
 		conf.setantispam(antispam);
+		conf.seticqdropauthreq(icqdropauthreq);
 		conf.setmailcheck(mailcheck);
 		conf.setmakelog(makelog);
 		conf.setaskaway(askaway);
@@ -1433,8 +1458,13 @@
     }
 
     db.close();
+
+    if(needredraw)
+        icqface::redraw();
+
     unblockmainscreen();
 
+
     return success;
 }
 
diff -Naur centerim.mob/src/icqface.cc centerim.icqdropauthreq/src/icqface.cc
--- centerim.mob/src/icqface.cc	2007-03-02 20:28:31.000000000 +0100
+++ centerim.icqdropauthreq/src/icqface.cc	2007-03-02 19:49:08.000000000 +0100
@@ -153,16 +153,29 @@
     sizeBigDlg.width = COLS-10;
     sizeBigDlg.height = LINES-7;
 
-    sizeWArea.x1 = (int) (COLS*0.32);
-    if(sizeWArea.x1 < 25)
-	sizeWArea.x1 = 25;
-
+    sizeWArea.x1 = conf.getleftpanelwidth();
+    if(sizeWArea.x1 < MinPanelWidth || sizeWArea.x1 > (COLS - MinPanelWidth)) {
+	sizeWArea.x1 = (int) (COLS*0.32); 
+	conf.setleftpanelwidth(sizeWArea.x1);
+    }
+    if(sizeWArea.x1 < MinPanelWidth || sizeWArea.x1 > (COLS - MinPanelWidth)) {
+	sizeWArea.x1 = MinPanelWidth;
+	conf.setleftpanelwidth(sizeWArea.x1);
+    }
+    
     sizeWArea.x2 = COLS-1;
     sizeWArea.y1 = 1;
 
-    sizeWArea.y2 = LINES - ((int) (LINES/4));
-    if(sizeWArea.y2 > LINES-6)
-	sizeWArea.y2 = LINES-6;
+    sizeWArea.y2 = conf.getlogpanelheight();
+    if(sizeWArea.y2 < MinPanelHeight || sizeWArea.y2 > (LINES - MinPanelHeight)) {
+	sizeWArea.y2 = (int) LINES / 4;
+	conf.setlogpanelheight(sizeWArea.y2);
+    }
+    if(sizeWArea.y2 < MinPanelHeight || sizeWArea.y2 > (LINES - MinPanelHeight)) {
+	sizeWArea.y2 = MinPanelHeight;
+	conf.setlogpanelheight(sizeWArea.y2);
+    }
+    sizeWArea.y2 = LINES - sizeWArea.y2;
 
     if(!mcontacts) {
 	mcontacts = new treeview(conf.getcolor(cp_main_menu),
@@ -2397,7 +2410,7 @@
     } else if(ev.gettype() == imevent::authorization) {
 	imauthorization *m = static_cast<imauthorization *>(&ev);
 
-	if(gethook(ev.getcontact().pname).getCapabs().count(hookcapab::authreqwithmessages)) {
+	if (gethook(ev.getcontact().pname).getCapabs().count(hookcapab::authreqwithmessages)) {
 	    editor.setcoords(sizeWArea.x1+2, sizeWArea.y1+3, sizeWArea.x2, sizeWArea.y2);
 	    editor.load(msg = m->getmessage(), "");
 	    editor.open();
@@ -2708,7 +2721,16 @@
     muins.clear();
     muins.push_back(passinfo);
 
-    chatlines = (int) ((sizeWArea.y2-sizeWArea.y1)*0.75);
+    chatlines = conf.getchatpanelheight();
+    if (chatlines < MinPanelHeight || chatlines > (LINES - MinPanelHeight - MinPanelHeight)){
+        chatlines = (int) ((sizeWArea.y2-sizeWArea.y1)*0.70);
+	conf.setchatpanelheight(chatlines);
+    }
+    if (chatlines < MinPanelHeight || chatlines > (LINES - MinPanelHeight - MinPanelHeight)){
+        chatlines = MinPanelHeight;
+	conf.setchatpanelheight(chatlines);
+    }
+
 //    workarealine(sizeWArea.y1+chatlines+1);
 
     editor.addscheme(cp_main_text, cp_main_text, 0, 0);
@@ -3343,6 +3365,22 @@
 	    if(c) face.extk = ACT_IGNORE;
 	    break;
 
+	case key_left_panel_move_right:
+	    face.leftpanelwidth_inc(1);
+	    break;
+       
+	case key_left_panel_move_left:
+            face.leftpanelwidth_inc(-1);
+            break;
+
+	case key_log_panel_move_up:
+	    face.logpanelheight_inc(1);
+	    break;
+       
+	case key_log_panel_move_down:
+            face.logpanelheight_inc(-1);
+            break;
+
 	case key_quickfind: face.extk = ACT_QUICKFIND; break;
     }
 
@@ -3446,6 +3484,12 @@
 	    if(face.passevent)
 		face.fullscreenize(face.passevent);
 	    break;
+	case key_chat_panel_move_up:
+	    face.chatpanelheight_inc(1);
+	    break;
+	case key_chat_panel_move_down:
+	    face.chatpanelheight_inc(-1);
+	    break;
 	case key_quit:
 	    return -1;
     }
@@ -3613,3 +3657,31 @@
 void icqface::icqprogress::hide() {
     w->close();
 }
+
+void icqface::leftpanelwidth_inc(const int inc) {
+    int i = conf.getleftpanelwidth();
+    if ( ((i+inc) >= MinPanelWidth) && ((i+inc) <= (COLS - MinPanelWidth))) {
+        conf.setleftpanelwidth(i+inc);
+        dotermresize = true ;
+    }
+}
+
+void icqface::logpanelheight_inc(const int inc) {
+    int i = conf.getlogpanelheight();
+    if (((i+inc) >= MinPanelHeight) && ((i+inc) <= (LINES - MinPanelHeight))) {
+        conf.setlogpanelheight(i+inc);
+        dotermresize = true ;
+    }
+}
+
+void icqface::chatpanelheight_inc(const int inc ) {
+    chatlines = conf.getchatpanelheight()+inc;
+    conf.setchatpanelheight(chatlines);
+    if(!(( chatlines > 0 ) && (chatlines < (sizeWArea.y2-sizeWArea.y1)*0.90) ) ){
+        chatlines = (int) ((sizeWArea.y2-sizeWArea.y1)*0.70);
+        conf.setchatpanelheight(chatlines);}
+
+    icqface::renderchathistory();
+    icqface::restoreworkarea();
+}
+
diff -Naur centerim.mob/src/icqface.h centerim.icqdropauthreq/src/icqface.h
--- centerim.mob/src/icqface.h	2007-03-02 20:28:31.000000000 +0100
+++ centerim.icqdropauthreq/src/icqface.h	2007-02-27 16:08:13.000000000 +0100
@@ -129,6 +129,9 @@
 	static void transferidle(dialogbox &db);
 	static void editchatidle(texteditor &e);
 
+	static const unsigned int MinPanelWidth = 10;
+	static const unsigned int MinPanelHeight = 10;
+
 	static void termresize(void);
 
 	void infoclear(dialogbox &db, icqcontact *c, const imcontact realdesc);
@@ -286,6 +289,9 @@
 	void userinfoexternal(const imcontact &ic);
 
 	bool selectpgpkey(string &keyid, bool secretonly = false);
+	void leftpanelwidth_inc(const int inc);
+	void logpanelheight_inc(const int inc);
+	void chatpanelheight_inc(const int inc);
 };
 
 extern icqface face;