Mike 2 лет назад
Родитель
Сommit
988daa3bee
2 измененных файлов с 15 добавлено и 0 удалено
  1. 1 0
      oscar/feedbag_store.go
  2. 14 0
      oscar/oservice.go

+ 1 - 0
oscar/feedbag_store.go

@@ -107,6 +107,7 @@ func (f *FeedbagStore) Retrieve(screenName string) ([]*feedbagItem, error) {
 			FeedbagAttributesPdFlags:         reflect.Uint32,
 			FeedbagAttributesPdMask:          reflect.Uint32,
 			FeedbagAttributesPdMode:          reflect.Uint8,
+			FeedbagAttributesNote:            reflect.String,
 		})
 		if err != nil {
 			return items, err

+ 14 - 0
oscar/oservice.go

@@ -587,6 +587,7 @@ func (s *snacServiceRequest) read(r io.Reader) error {
 	}
 	return s.TLVPayload.read(r, map[uint16]reflect.Kind{
 		0x01: reflect.Slice,
+		0x28: reflect.Slice,
 	})
 }
 
@@ -606,6 +607,19 @@ func ReceiveAndSendServiceRequest(cr *ChatRegistry, sess *Session, flap flapFram
 		return err
 	}
 
+	// this prevents AIM client from crashing when using the
+	// store/edit email address feature.
+	if _, hasEditBuddy := snacPayload.getTLV(0x28); hasEditBuddy {
+		snacFrameOut := snacFrame{
+			foodGroup: OSERVICE,
+			subGroup:  OServiceErr,
+		}
+		snacPayloadOut := &snacOServiceErr{
+			code: ErrorCodeNotSupportedByHost,
+		}
+		return writeOutSNAC(snac, flap, snacFrameOut, snacPayloadOut, sequence, w)
+	}
+
 	fmt.Printf("receiveAndSendServiceRequest read SNAC body: %+v\n", snacPayload)
 
 	// just say that all the services are offline