ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] jabber и jabber-jit: патч для автоматической конвертации icq номеров в ники владельцев.
@ 2004-03-20 10:57 Mishka Plugnikov
  2004-03-21 12:56 ` [devel] " Michael Shigorin
  2004-03-30 21:49 ` Mikhail Zabaluev
  0 siblings, 2 replies; 5+ messages in thread
From: Mishka Plugnikov @ 2004-03-20 10:57 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

Здравствуйте.
Скорее всего это просьба для мантйнера jabber, Михаила Забалуева, так как патч 
предназначается для jabber сервера.
Патч, приклеплён к письму, но так-же доступен по ссылке: 
http://jit.jabberstudio.org/mod_roster.c.diff
При регистрации у пользвателя icq транспорта, jit вытягивает icq номера.
С этим патчем работает автоматическио преобразование номаров в ники 
владельцев.


[-- Attachment #2: mod_roster.c.diff --]
[-- Type: text/x-diff, Size: 1838 bytes --]

# This patch is included in jabberd 1.4.3 and newer

--- mod_roster.c	Thu Jan 16 14:44:47 2003
+++ mod_roster.c	Sun Jan  5 23:40:34 2003
@@ -58,7 +58,7 @@
     return ret;
 }
 
-xmlnode mod_roster_get_item(xmlnode roster, jid id, int *newflag)
+xmlnode mod_roster_get_item(xmlnode roster, jid id, char *name, int *newflag)
 {
     xmlnode ret;
 
@@ -71,6 +71,8 @@
         log_debug("mod_roster","creating");
         ret = xmlnode_insert_tag(roster,"item");
         xmlnode_put_attrib(ret,"jid",jid_full(id));
+        if(name != NULL)
+            xmlnode_put_attrib(ret,"name",name);
         xmlnode_put_attrib(ret,"subscription","none");
         *newflag = 1;
     }
@@ -172,7 +174,7 @@
 
     newflag = to = from = 0;
     roster = mod_roster_get(m->user);
-    item = mod_roster_get_item(roster,m->packet->to, &newflag);
+    item = mod_roster_get_item(roster,m->packet->to,NULL,&newflag);
 
     /* vars */
     if(j_strcmp(xmlnode_get_attrib(item,"subscription"),"to") == 0)
@@ -302,7 +304,7 @@
             if(id == NULL || jid_cmpx(jid_user(m->s->id),id,JID_USER|JID_SERVER) == 0) continue;
 
             /* zoom to find the existing item in the current roster, and hide it */
-            item = mod_roster_get_item(roster, id, &newflag);
+            item = mod_roster_get_item(roster, id, NULL, &newflag);
             xmlnode_hide(item);
 
             /* drop you sukkah */
@@ -382,7 +384,7 @@
 
     /* now we can get to work and handle this user's incoming subscription crap */
     roster = mod_roster_get(m->user);
-    item = mod_roster_get_item(roster,m->packet->from, &newflag);
+    item = mod_roster_get_item(roster,m->packet->from,xmlnode_get_attrib(m->packet->x,"name"),&newflag);
     reply2 = reply = NULL;
     jid_set(m->packet->to,NULL,JID_RESOURCE); /* make sure we're only dealing w/ the user id */
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-03-31 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-20 10:57 [devel] jabber и jabber-jit: патч для автоматической конвертации icq номеров в ники владельцев Mishka Plugnikov
2004-03-21 12:56 ` [devel] " Michael Shigorin
2004-03-22 11:10   ` Mishka Plugnikov
2004-03-30 21:49 ` Mikhail Zabaluev
2004-03-31 15:19   ` Mishka Plugnikov

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git