[ekg2-commit] ekg2: sessions.c (HEAD) themes.c (HEAD) userlist.c (HEAD) [peres]

CVS commit cvs w toxygen.net
Wto, 16 Paź 2007, 20:33:43 CEST


Module name:	ekg2
Changes by:	peres	2007-10-16 20:33:41

Modified files:
	sessions.c themes.c userlist.c

Log message:
Removing 'jid:' hacks.

Index: sessions.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/sessions.c,v
diff -d -u -r1.140 -r1.141
--- sessions.c	6 Oct 2007 17:46:37 -0000	1.140
+++ sessions.c	16 Oct 2007 18:33:40 -0000	1.141
@@ -164,13 +164,7 @@
 	}
 	
 	s = xmalloc(sizeof(session_t));
-		/* jabber hack below, to be removed when 'jid:' support finally removed
-		 * dj suggested putting such a thing in session_read(), but putting it here
-		 * will also prevent user from creating 'jid:' sessions himself */
-	if (!xstrncasecmp(uid, "jid:", 4))
-		s->uid	= saprintf("xmpp:%s", uid+4);
-	else
-		s->uid	= xstrdup(uid);
+	s->uid		= xstrdup(uid);
 	s->status 	= EKG_STATUS_NA;
 	s->plugin 	= pl;
 #ifdef HAVE_FLOCK

Index: themes.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/themes.c,v
diff -d -u -r1.209 -r1.210
--- themes.c	8 Oct 2007 08:39:35 -0000	1.209
+++ themes.c	16 Oct 2007 18:33:40 -0000	1.210
@@ -716,7 +716,7 @@
 	/* 1) let's check if we have such window as target... */
 
 		/* if it's jabber and we've got '/' in target strip it. [XXX, window resources] */
-		if ((!xstrncmp(target, "jid:", 4) || !xstrncmp(target, "xmpp:", 5)) && (tmp = xstrchr(target, '/'))) {
+		if ((!xstrncmp(target, "xmpp:", 5)) && (tmp = xstrchr(target, '/'))) {
 			newtarget = xstrndup(target, tmp - target);
 			w = window_find_s(session, newtarget);		/* and search for windows with stripped '/' */
 			/* even if w == NULL here, we use newtarget to create window without resource */
@@ -746,7 +746,7 @@
 		if (u && u->nickname)
 			target = u->nickname;			/* use nickname instead of target */
 		else if (u && u->uid && ( /* don't use u->uid, if it has resource attached */
-				(xstrncmp(u->uid, "jid:", 4) && xstrncmp(u->uid, "xmpp:", 5)) || !xstrchr(u->uid, '/')))
+				xstrncmp(u->uid, "xmpp:", 5) || !xstrchr(u->uid, '/')))
 			target = u->uid;			/* use uid instead of target. XXX here. think about jabber resources */
 		else if (newtarget)
 			target = newtarget;			/* use target with stripped '/' */

Index: userlist.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/userlist.c,v
diff -d -u -r1.109 -r1.110
--- userlist.c	5 Sep 2007 18:36:09 -0000	1.109
+++ userlist.c	16 Oct 2007 18:33:41 -0000	1.110
@@ -657,46 +657,32 @@
 userlist_t *userlist_find_u(list_t *userlist, const char *uid)
 {
 	list_t l;
-	char *myuid = NULL;
 
 	if (!uid || !userlist)
 		return NULL;
 
-		/* another weird 'jid:' hack, to be reverted when 'jid:' support abandomed */
-	if (!xstrncasecmp(uid, "jid:", 4)) {
-		valid_uid(uid); /* make warning appear */
-		myuid = saprintf("xmpp:%s", uid+4);
-	}
-
 	for (l = *userlist; l; l = l->next) {
 		userlist_t *u = l->data;
 		const char *tmp;
 		int len;
 
-		if (!xstrcasecmp(u->uid, myuid ? myuid : uid)) {
-			xfree(myuid);
+		if (!xstrcasecmp(u->uid, uid))
 			return u;
-		}
 
-		if (u->nickname && !xstrcasecmp(u->nickname, uid)) {
-			xfree(myuid);
+		if (u->nickname && !xstrcasecmp(u->nickname, uid))
 			return u;
-		}
 
 		/* porównujemy resource; if (len > 0) */
 
-		if (!(tmp = xstrchr(uid, '/')) || (xstrncmp(uid, "jid:", 4) && xstrncmp(uid, "xmpp:", 5)))
+		if (!(tmp = xstrchr(uid, '/')) || (xstrncmp(uid, "xmpp:", 5)))
 			continue;
 
 		len = (int)(tmp - uid);
 
-		if (len > 0 && !xstrncasecmp(myuid ? myuid : uid, u->uid, len)) {
-			xfree(myuid);
+		if (len > 0 && !xstrncasecmp(uid, u->uid, len))
 			return u;
-		}
 	}
 
-	xfree(myuid);
 	return NULL;
 }
 


Więcej informacji o liście dyskusyjnej ekg2-commit