• R/O
  • R/W (SSH)
  • R/W (HTTPS)

afficheur: Commit Details


Commit MetaInfo

Revision802 (tree)
Time2011-06-19 19:42:08
Authorichi

Log Message

Identica:XMPP経由のアイコン不具合を修正

Change Summary

Diff

--- Afficheur/trunk/ServiceIdentica.m (revision 801)
+++ Afficheur/trunk/ServiceIdentica.m (revision 802)
@@ -748,13 +748,24 @@
748748 }
749749 icon = [[source elementForName:@"icon"] stringValue];
750750 }
751- if (!screen_name)
751+ NSXMLElement *author = [entry elementForName:@"author"];
752+ if (author)
752753 {
753- NSXMLElement *author = [entry elementForName:@"author"];
754- if (author)
754+ LOG(@"[%@(%@) performReceiveMessage] author\n%@", [self className], _service, author);
755+ screen_name = [[author elementForName:@"name"] stringValue];
756+ name = [[author elementForName:@"displayName" xmlns:@"http://portablecontacts.net/spec/1.0"] stringValue];
757+ NSArray *elements = [author elementsForName:@"link"];
758+ NSEnumerator *enumerator = [elements objectEnumerator];
759+ id element;
760+ while ((element = [enumerator nextObject]))
755761 {
756- screen_name = [[author elementForName:@"name"] stringValue];
762+ NSXMLNode *node = [element attributeForName:@"ns1:width"];
763+ if ([[node stringValue] isEqualToString:@"48"])
764+ {
765+ icon = [[element attributeForName:@"href"] stringValue];
766+ }
757767 }
768+ LOG(@"[%@(%@) performReceiveMessage] author\nscreen_name='%@'\nname='%@'\nicon='%@'", [self className], _service, screen_name, name, icon);
758769 }
759770 xmpp_id = [[entry elementForName:@"id"] stringValue];
760771 published = [[entry elementForName:@"published"] stringValue];
@@ -786,6 +797,7 @@
786797 {
787798 item_id = attribute;
788799 }
800+#if 0
789801 attribute = [[notice_info attributeForName:@"repeat_of"] stringValue];
790802 if (attribute)
791803 {
@@ -836,6 +848,7 @@
836848 options:OgreMultilineOption];
837849 LOG(@"[%@(%@) performReceiveMessage]span\n%@", [self className], _service, body);
838850 }
851+#endif
839852 }
840853 if (body && screen_name && icon && xmpp_id && published)
841854 {
@@ -925,6 +938,15 @@
925938 }
926939 LOG(@"[%@(%@) performReceiveMessage]\ninReplyUser = %@\ncomment = %@", [self className], _service, inReplyUser, comment);
927940 }
941+ if (name && (![name isEqualToString:@""]) &&(![name isEqualToString:screen_name]))
942+ {
943+ name = [NSString stringWithFormat:@" / %@", name];
944+ }
945+ else
946+ {
947+ name = @"";
948+ }
949+ LOG(@"[%@(%@) performReceiveMessage] author\nscreen_name='%@'\nname='%@'\nicon='%@'", [self className], _service, screen_name, name, icon);
928950 NSDictionary *item = [self createItem:item_id
929951 withUser:screen_name
930952 name:name
旧リポジトリブラウザで表示