ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Mishka Plugnikov <mike@stankin.ru>
To: devel@altlinux.ru
Subject: [devel] jabber и jabber-jit: патч для автоматической конвертации icq номеров в ники владельцев.
Date: Sat, 20 Mar 2004 13:57:55 +0300
Message-ID: <200403201355.40342.mike@stankin.ru> (raw)

[-- 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 */
 

             reply	other threads:[~2004-03-20 10:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-20 10:57 Mishka Plugnikov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200403201355.40342.mike@stankin.ru \
    --to=mike@stankin.ru \
    --cc=devel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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