Re: CenterICQ/CenterIM suggestion - disable ICQ auth requests & ASCII hierarchy
Mark Pustjens <[email protected]> Fri, 2 Mar 2007 21:43:38 +0100 (CET)
| Newsgroups | gmane.network.centericq |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2 Mar 2007, Mark Pustjens wrote: That one didn't have all the files in the patch, this one does > 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 > > -- He had that kind of real deep tan that rich people spend ages trying to achieve with expensive holidays and bits of tinfoil, when all you really need to do to obtain one is work your arse off in the open every day. (Equal rites) _______________________________________________ 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, 15.8 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;
--- centerim.test/src/icqconf.cc 2007-03-02 20:39:40.000000000 +0100
+++ centerim.icqdropauthreq/src/icqconf.cc 2007-03-02 20:12:59.000000000 +0100
@@ -53,7 +53,7 @@
autoaway = autona = 0;
- hideoffline = antispam = makelog = askaway = logtimestamps =
+ hideoffline = antispam = icqdropauthreq = makelog = askaway = logtimestamps =
logonline = emacs = proxyssl = proxyconnect = notitles =
debug = timestampstothesecond = false;
@@ -248,6 +248,10 @@
of << "bind contact\t/\tquickfind" << endl << endl;
of << "bind contact\t\\cn\tnext_chat" << endl;
of << "bind contact\t\\cb\tprev_chat" << endl;
+ of << "bind contact\t[\tleft_panel_move_left" << endl;
+ of << "bind contact\t]\tleft_panel_move_right" << endl;
+ of << "bind contact\t{\tlog_panel_move_up" << endl;
+ of << "bind contact\t}\tlog_panel_move_down" << endl;
of << "bind history\t/\tsearch" << endl;
of << "bind history\ts\tsearch" << endl;
of << "bind history\tn\tsearch_again" << endl;
@@ -262,6 +266,8 @@
of << "bind editor\t\\a?\tinfo" << endl;
of << "bind editor\t<F2>\tshow_urls" << endl;
of << "bind editor\t<F9>\tfullscreen" << endl << endl;
+ of << "bind editor\t<F4>\tchat_panel_move_up" << endl;
+ of << "bind editor\t<F5>\tchat_panel_move_down" << endl;
of << "bind info\t<F2>\tshow_urls" << endl;
of << "bind info\t<F6>\tuser_external_action" << endl;
@@ -377,8 +383,14 @@
if(param == "show_urls") k.action = key_show_urls; else
if(param == "rss_check") k.action = key_rss_check; else
if(param == "multiple_recipients") k.action = key_multiple_recipients; else
- if(param == "user_external_action") k.action = key_user_external_action;
- else continue;
+ if(param == "user_external_action") k.action = key_user_external_action; else
+ if(param == "left_panel_move_left") k.action = key_left_panel_move_left; else
+ if(param == "left_panel_move_right") k.action = key_left_panel_move_right; else
+ if(param == "log_panel_move_up") k.action = key_log_panel_move_up; else
+ if(param == "log_panel_move_down") k.action = key_log_panel_move_down; else
+ if(param == "chat_panel_move_up") k.action = key_chat_panel_move_up; else
+ if(param == "chat_panel_move_down") k.action = key_chat_panel_move_down; else
+ continue;
keys.push_back(k);
}
@@ -449,6 +461,7 @@
if(param == "autoaway") autoaway = atol(buf.c_str()); else
if(param == "autona") autona = atol(buf.c_str()); else
if(param == "antispam") antispam = true; else
+ if(param == "icqdropauthreq") icqdropauthreq = true; else
if(param == "mailcheck") mailcheck = true; else
if(param == "quotemsgs") quote = true; else
if(param == "sockshost") setsockshost(buf); else
@@ -474,6 +487,9 @@
if(param == "logonline") logonline = true; else
if(param == "fromcharset") fromcharset = buf; else
if(param == "tocharset") tocharset = buf; else
+ if(param == "left_panel_width") leftpanelwidth = atol(buf.c_str()); else
+ if(param == "log_panel_height") logpanelheight = atol(buf.c_str()); else
+ if(param == "chat_panel_height") chatpanelheight = atol(buf.c_str()); else
if(param == "timestampstothesecond") settimestampstothesecond(true); else
if(param == "ptp") {
ptpmin = atoi(getword(buf, "-").c_str());
@@ -528,6 +544,7 @@
if(emacs) f << "emacs" << endl;
if(getquote()) f << "quotemsgs" << endl;
if(getantispam()) f << "antispam" << endl;
+ if(geticqdropauthreq()) f << "icqdropauthreq" << endl;
if(getmailcheck()) f << "mailcheck" << endl;
if(getaskaway()) f << "askaway" << endl;
@@ -591,6 +608,10 @@
if(getmakelog()) f << "log" << endl;
if(getproxyconnect()) f << "proxy_connect" << endl;
if(getproxyssl()) f << "proxy_ssl" << endl;
+
+ if(getleftpanelwidth()) f << "left_panel_width\t" << getleftpanelwidth() << endl;
+ if(getlogpanelheight()) f << "log_panel_height\t" << getlogpanelheight() << endl;
+ if(getchatpanelheight()) f << "chat_panel_height\t" << getchatpanelheight() << endl;
vector<imaccount>::iterator ia;
for(ia = accounts.begin(); ia != accounts.end(); ++ia)
@@ -966,6 +987,10 @@
antispam = fas;
}
+void icqconf::seticqdropauthreq(bool fas) {
+ icqdropauthreq = fas;
+}
+
void icqconf::setmailcheck(bool fmc) {
mailcheck = fmc;
}